From 2f34bdf8ae8381ee3c39dc934ed7e59702773cb0 Mon Sep 17 00:00:00 2001 From: Manny Date: Fri, 25 Jun 2021 21:24:51 -0400 Subject: [PATCH] Manny finsihed LogginLab --- .DS_Store | Bin 0 -> 6148 bytes LogginLab1.iml | 16 ++++++++++++++++ src/.DS_Store | Bin 0 -> 6148 bytes src/main/java/LogginLab.java | 13 ++++++++++--- src/test/java/LogginLabTest.java | 20 +++++++++++++++++++- 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .DS_Store create mode 100644 LogginLab1.iml create mode 100644 src/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b76134be61280221cd56fee2554ed8b230bf78cc GIT binary patch literal 6148 zcmeHK%}VP)6rO3TCKe=u3k4SgF5Glc?Y+0#P=8i}Vni4I)Wn3_Ku9D>?V=Qd58wmn z)}QxKAHo-L?>RG5QR>}YM9MjE<~wudoHNXqFh7hj-s<`*j9H8^0~E1jLi2^-IO>R$ zv-uXy0IesDo`0dIpV<|iHdLO@E6lQt7{=!S;%EaW9VNO@g>P*!< zb~;JV$=$r0wcNCAEjpnecy4+S`gvzBh&Q6(B8a!sEjJI+Lk!+ak_ZBn?RxuR&}&2 zJ&YnG28aP-UDj~E~Z#)<)6S$Ec3uq1u9jw}w(S^;_rih^;4!uJ#~1JKr3C + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..dda56826a997b35659c4924c3555568287a24778 GIT binary patch literal 6148 zcmeHKJ5EC}5S)cqM50Ma=__ypD+(vz0wjb2DUc$ee^t)K(U|=RC3<=i4Go%=)?=@C zY this.threshold; + } } + + // Write a test for the method in the Test class. + + diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..120f5f1 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -23,7 +23,7 @@ public void thresholdExceeds() { for (Integer i = 1; i <= finalLimit; i++) { if (lab.thresholdExceeds(i)) { - logger.log(Level.INFO, "Threshold not reached! It is "+i); + logger.log(Level.INFO, "Threshold not reached! It is " + i); assertTrue(lab.thresholdExceeds(i)); } else { logger.log(Level.INFO, "Threshold finally reached!"); @@ -31,4 +31,22 @@ public void thresholdExceeds() { } } } + @org.junit.Test + public void thresholdReached() { + Integer finalLimit = 5; + + LogginLab lab = new LogginLab(); + lab.setThreshold(finalLimit); + + for (Integer i = 1; i <= finalLimit; i++) { + if (lab.thresholdReached(i)) { + logger.log(Level.INFO, "Threshold has been reached!"); + assertTrue(lab.thresholdReached(i)); + } else { + logger.log(Level.INFO, "Threshold has not been reached! It is " + i); + assertFalse(lab.thresholdReached(i)); + } + } + + } } \ No newline at end of file