diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..24d4633 Binary files /dev/null and b/.DS_Store differ diff --git a/LogginLab1.iml b/LogginLab1.iml new file mode 100644 index 0000000..0ddf51c --- /dev/null +++ b/LogginLab1.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..045476c Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 0000000..1730d56 Binary files /dev/null and b/src/main/.DS_Store differ diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store new file mode 100644 index 0000000..ce62b22 Binary files /dev/null and b/src/main/java/.DS_Store differ diff --git a/src/main/java/LogginLab.java b/src/main/java/LogginLab.java index 11744ac..3ec2533 100644 --- a/src/main/java/LogginLab.java +++ b/src/main/java/LogginLab.java @@ -10,6 +10,7 @@ public LogginLab() { this.threshold = 0; } + public static void main(String[] args) { logger.log(Level.INFO, "Hello World!"); @@ -32,6 +33,11 @@ public boolean thresholdExceeds(Integer limit) { return (this.threshold > limit); } + public boolean thresholdReached(Integer limit) {return (this.threshold < limit);} + + + + // Write a method called thresholdReached, returns true if argument 'limit' is over the threshold. // Write a test for the method in the Test class. } diff --git a/src/test/.DS_Store b/src/test/.DS_Store new file mode 100644 index 0000000..1730d56 Binary files /dev/null and b/src/test/.DS_Store differ diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..4fa5aaa 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -31,4 +31,20 @@ public void thresholdExceeds() { } } } + @org.junit.Test + public void thresholdReached(){ + Integer finalLimit = 5; + int maxLimit=6; + LogginLab lab = new LogginLab(); + lab.setThreshold(finalLimit); + for (Integer i=1;i<=maxLimit; i++){ + if (lab.thresholdReached(i)){ + logger.log(Level.INFO,"Theshold over the limit"); + assertTrue(lab.thresholdReached(i)); + }else { + logger.log(Level.INFO,"Limit over the theshold"+1); + } + } + + } } \ No newline at end of file