Browse Source

TestTimmer berichtigt, da er manchmal Fehler ausspukt

remotes/origin/JaFi
jannisfingerhut 2 years ago
parent
commit
1e2cdf11b2
  1. 15
      bin/LernProgramm/testProgramm.java

15
bin/LernProgramm/testProgramm.java

@ -140,6 +140,10 @@ class testProgramm {
assertEquals(expected, actual);
}
private int getNumber() {
return 0;
}
@ -148,14 +152,11 @@ class testProgramm {
int actualTime = (int) (Math.random() * 10 + 1);
int estimatedTime = (int) (Math.random() * 10 + 1);
int difference = Math.abs(actualTime - estimatedTime);
boolean result = false;
if (difference == 0) {
result = true;
} else if (difference <= 2) {
result = true;
} else if (difference <= 4) {
difference--;
boolean result = true;
result = true;
}
assertTrue(result);
}

Loading…
Cancel
Save