From 1a43055101c1b7915cb68a6e7ff86e56cef6c7dc Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 25 Jun 2021 15:17:18 -0400 Subject: [PATCH] Modified the main file and passed my generated test case --- LogginLab1.iml | 16 ++++++++++++++++ src/main/java/LogginLab.java | 6 ++++++ src/test/java/LogginLabTest.java | 10 +++++----- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 LogginLab1.iml 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/main/java/LogginLab.java b/src/main/java/LogginLab.java index 11744ac..edac4ce 100644 --- a/src/main/java/LogginLab.java +++ b/src/main/java/LogginLab.java @@ -34,4 +34,10 @@ public boolean thresholdExceeds(Integer 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) { + if (this.threshold < limit) { + }return true; + } + + } diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..eb90a7f 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -21,14 +21,14 @@ public void thresholdExceeds() { LogginLab lab = new LogginLab(); lab.setThreshold(finalLimit); - for (Integer i = 1; i <= finalLimit; i++) { - if (lab.thresholdExceeds(i)) { - logger.log(Level.INFO, "Threshold not reached! It is "+i); - assertTrue(lab.thresholdExceeds(i)); + int i = 10; + if (lab.thresholdReached(i)) { + logger.log(Level.INFO, "I did it! It is "+i); + assertTrue(lab.thresholdReached(i)); } else { logger.log(Level.INFO, "Threshold finally reached!"); assertFalse(lab.thresholdExceeds(i)); - } + } } } \ No newline at end of file