diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6b5137a 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..75c420c 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..db469c4 Binary files /dev/null and b/src/main/.DS_Store differ diff --git a/src/main/java/LogginLab.java b/src/main/java/LogginLab.java index 11744ac..f534683 100644 --- a/src/main/java/LogginLab.java +++ b/src/main/java/LogginLab.java @@ -31,7 +31,7 @@ public void setThreshold(Integer threshold) { public boolean thresholdExceeds(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. -} + public boolean thresholdReached(Integer limit) {return (this.threshold < limit); } +} \ No newline at end of file diff --git a/src/test/.DS_Store b/src/test/.DS_Store new file mode 100644 index 0000000..c878815 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..42a438f 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -31,4 +31,19 @@ public void thresholdExceeds() { } } } + @org.junit.Test + public void thresholdReached() { + Integer finalLimit = 7; + + LogginLab lab = new LogginLab(); + lab.setThreshold(finalLimit); + + for (Integer i = 10; i > finalLimit; i--) { + if (lab.thresholdReached(i)) { + assertTrue(lab.thresholdReached(i)); + } else { + assertFalse(lab.thresholdReached(i)); + } + } + } } \ No newline at end of file