|
@ -1,5 +1,7 @@ |
|
|
import org.junit.Test; |
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
|
public class CalculationsTest { |
|
|
public class CalculationsTest { |
|
|
|
|
|
|
|
@ -41,5 +43,12 @@ public class CalculationsTest { |
|
|
Calculations fact = new Calculations(); |
|
|
Calculations fact = new Calculations(); |
|
|
fact.calculateFactorial(-5); // Should throw IllegalArgumentException |
|
|
fact.calculateFactorial(-5); // Should throw IllegalArgumentException |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testIsPrime() { |
|
|
|
|
|
assertTrue(Calculations.isPrime(2)); // Prime number |
|
|
|
|
|
assertTrue(Calculations.isPrime(3)); // Prime number |
|
|
|
|
|
assertTrue(Calculations.isPrime(5)); // Prime number |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|