diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..efc21ae Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..11c1187 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..7509e11 Binary files /dev/null and b/src/main/.DS_Store differ diff --git a/src/main/java/.idea/.gitignore b/src/main/java/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/src/main/java/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/src/main/java/.idea/java.iml b/src/main/java/.idea/java.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/src/main/java/.idea/java.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/.idea/modules.xml b/src/main/java/.idea/modules.xml new file mode 100644 index 0000000..a127731 --- /dev/null +++ b/src/main/java/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/.idea/vcs.xml b/src/main/java/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/src/main/java/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/LogginLab.class b/src/main/java/LogginLab.class new file mode 100644 index 0000000..b4e8dd7 Binary files /dev/null and b/src/main/java/LogginLab.class differ diff --git a/src/main/java/LogginLab.java b/src/main/java/LogginLab.java index 0b4965f..204c8db 100644 --- a/src/main/java/LogginLab.java +++ b/src/main/java/LogginLab.java @@ -29,13 +29,20 @@ public void setThreshold(Integer threshold) { } public boolean thresholdExceeds(Integer limit) { - if (this.threshold > limit) + if (this.threshold > limit) return true; else return false; } - + public boolean thresholdReached(Integer limit) { + if (limit > this.threshold) + return true; + else + return false; + } // Write a method called thresholdReached, returns true if argument 'limit' is over the threshold. // use thresholdExceeds for a pattern. // 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..7509e11 Binary files /dev/null and b/src/test/.DS_Store differ diff --git a/src/test/java/.DS_Store b/src/test/java/.DS_Store new file mode 100644 index 0000000..f8c2565 Binary files /dev/null and b/src/test/java/.DS_Store differ diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..b156b4d 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -16,7 +16,7 @@ public void tearDown() throws Exception { @org.junit.Test public void thresholdExceeds() { - Integer finalLimit = 5; + Integer finalLimit = 9001; LogginLab lab = new LogginLab(); lab.setThreshold(finalLimit); @@ -31,4 +31,21 @@ public void thresholdExceeds() { } } } -} \ No newline at end of file + @org.junit.Test + public void thresholdReached(){ + Integer finalLimit = 9001; + + LogginLab lab = new LogginLab(); + lab.setThreshold(finalLimit); + + for (Integer i = 1; i <= finalLimit; i++){ + if (lab.thresholdReached(i)) { + logger.log(Level.INFO, "Pitiful Power" + i); + assertTrue(lab.thresholdReached(i)); + }else { + logger.log(Level.INFO, "It's over 9000!"); + assertFalse(lab.thresholdReached(i)); + } + } + } + }