|
@ -140,22 +140,23 @@ class testProgramm { |
|
|
assertEquals(expected, actual); |
|
|
assertEquals(expected, actual); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int getNumber() { |
|
|
private int getNumber() { |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
@Test |
|
|
@Test |
|
|
public void testTimer() { |
|
|
public void testTimer() { |
|
|
int actualTime = (int) (Math.random() * 10 + 1); |
|
|
|
|
|
|
|
|
int actualTime = (int) (Math.random() * 10 + 1); |
|
|
int estimatedTime = (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) { |
|
|
|
|
|
|
|
|
int difference = Math.abs(actualTime - estimatedTime); |
|
|
|
|
|
difference--; |
|
|
|
|
|
boolean result = true; |
|
|
|
|
|
|
|
|
result = true; |
|
|
result = true; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assertTrue(result); |
|
|
assertTrue(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|