|
|
@ -1,7 +1,7 @@ |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
import static org.junit.Assert.assertFalse; |
|
|
|
|
|
|
|
public class CalculationsTest { |
|
|
|
|
|
|
@ -46,9 +46,16 @@ public class CalculationsTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testIsPrime() { |
|
|
|
assertTrue(Calculations.isPrime(2)); // Prime number |
|
|
|
assertTrue(Calculations.isPrime(3)); // Prime number |
|
|
|
assertTrue(Calculations.isPrime(5)); // Prime number |
|
|
|
// Prime |
|
|
|
assertTrue(Calculations.isPrime(2)); |
|
|
|
assertTrue(Calculations.isPrime(3)); |
|
|
|
assertTrue(Calculations.isPrime(5)); |
|
|
|
|
|
|
|
// Non-Prime |
|
|
|
assertFalse(Calculations.isPrime(22)); |
|
|
|
assertFalse(Calculations.isPrime(25)); |
|
|
|
assertFalse(Calculations.isPrime(27)); |
|
|
|
assertFalse(Calculations.isPrime(30)); |
|
|
|
} |
|
|
|
} |
|
|
|
|