Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main/java/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/main/java/.idea/java.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main/java/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/java/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added src/main/java/LogginLab.class
Binary file not shown.
11 changes: 9 additions & 2 deletions src/main/java/LogginLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}


Binary file added src/test/.DS_Store
Binary file not shown.
Binary file added src/test/java/.DS_Store
Binary file not shown.
21 changes: 19 additions & 2 deletions src/test/java/LogginLabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -31,4 +31,21 @@ public void thresholdExceeds() {
}
}
}
}
@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));
}
}
}
}