From 340116f30638043dcc02b424ae07ddfa2b428511 Mon Sep 17 00:00:00 2001 From: Alena Bandarovich Date: Fri, 9 Feb 2024 23:14:45 +0100 Subject: [PATCH] Test: Test assert true for prime numbers --- src/test/java/CalculationsTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/CalculationsTest.java b/src/test/java/CalculationsTest.java index 1073c19..3aec84b 100644 --- a/src/test/java/CalculationsTest.java +++ b/src/test/java/CalculationsTest.java @@ -1,5 +1,7 @@ import org.junit.Test; + import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class CalculationsTest { @@ -41,5 +43,12 @@ public class CalculationsTest { Calculations fact = new Calculations(); 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 + } }