From a423920b49f80fc256d0aef6ec5942ade6c9b6da Mon Sep 17 00:00:00 2001 From: Freddy Date: Wed, 26 Oct 2022 21:34:06 -0400 Subject: [PATCH] Submitting LogginLab java --- .DS_Store | Bin 0 -> 6148 bytes LogginLab1.iml | 16 ++++++++++++++++ pom.xml | 4 ++++ src/.DS_Store | Bin 0 -> 6148 bytes src/main/java/LogginLab.java | 2 ++ src/test/.DS_Store | Bin 0 -> 6148 bytes src/test/java/LogginLabTest.java | 10 ++++++++-- 7 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 LogginLab1.iml create mode 100644 src/.DS_Store create mode 100644 src/test/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ba9629c35b80e59677b75dabacd7992d68a385cc GIT binary patch literal 6148 zcmeHK!EO^V5FIBe*;R#<14z9fS?VCSqj!lvvSt${#3PkW9MEoXa>8%yZED7#Iwe=0#fC+}Je)VGs^m zd&_0-;8|Pu4v$uCy*xVTw)NBA;c68I5BDEGKOKI`FAMXPX~34pp0{$};~Kuf@N@ng zPmA0XAK+O>ucHKo0bxKGxIG5^i4^SK-Y3Y&!hkSvM;YMrK|>iMkCj7vbfB + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 68a484b..b24ca72 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,10 @@ test + + 19 + 19 + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1e24b2930aecb7a56c104dc9cf994e0d6b6ac847 GIT binary patch literal 6148 zcmeHK!AiqG5S^{jrijpkLXQEjMQbY+@e->Zyc*GiN=;1BV49UCwTDv3SwF_BU*hlR z% za7+ub{C)=L+gZ>DA0kMmzTZC1ZM-W{8?hjR9;A>>`Mvz)7mU&e^FO=>4{?-cjmDcO zEm(_7WxH%I+gIM59C?|a4bzT4xS-LglyOk>{opL>jk?v<1DRxgl=KEFAPRfva(Nyl zp&WJOFbPu?>*)!*VpqD=+IZY*?$n)Ddv{WI#=Ff%-PvxnCzFc3w!XP{(!G!SiF{H! z1A+gqk`;pmJY(l`-;drPiDhz&w!**gV`K)H0cPMYF<{Oxd-*TDG`}k|zzocV0XiQX zR6^Hau2CHw*r*Z!k*<+Su&=KEhz=PLU4ywsw4ewbil{?{DKUhp9E1+XdDr;o8g)1b z^<-SfJXx3uMVP`vILaM_tC3q~fEoD8z=9rDDgPh+T>pO!;t?~z4E!qwgmvg0c5q83 zx6W*ia;<}UjY>j(xyH{B?5I?XzLbh 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 0000000000000000000000000000000000000000..4b4aae747c7f40b018fd28fa2308a4587f783116 GIT binary patch literal 6148 zcmeHK!AiqG5Z!H~O({YS3OxqA7OkyRikBGc!K)EHsMN$1jmE4rX?rMzob`wN5`RZ$ zb~gpBo&=FH1G8^4JF{WlhMf#!jJu<7hcSyWW`ZJ?sxW*bxQ@CYC2c7Ka@^xM7B@jG z0(iy^N&Y_rcyEFye)#jLA_>!~ikyD+cg>ut506H3Tg$#AduB{7MVy(47uR&4J oFIPAZfr%`|;EScW4k`ugHckK?jk!XwfY6VCq=5!v;7=L&04h0DwEzGB literal 0 HcmV?d00001 diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..bd16d6d 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -21,14 +21,20 @@ public void thresholdExceeds() { LogginLab lab = new LogginLab(); lab.setThreshold(finalLimit); - for (Integer i = 1; i <= finalLimit; i++) { + for (Integer i = 1; i <= 5; i++) { if (lab.thresholdExceeds(i)) { logger.log(Level.INFO, "Threshold not reached! It is "+i); assertTrue(lab.thresholdExceeds(i)); + } else if (lab.thresholdReached(i)){ + logger.log(Level.INFO, "Threshold exceeded Limit!"); + assertFalse(lab.thresholdExceeds(finalLimit)); } else { logger.log(Level.INFO, "Threshold finally reached!"); assertFalse(lab.thresholdExceeds(i)); } } } -} \ No newline at end of file +} + +// Write a method called thresholdReached, returns true if argument 'limit' is over the threshold. +// Write a test for the method in the Test class. \ No newline at end of file