diff --git a/src/test/java/CalculationsTest.java b/src/test/java/CalculationsTest.java index 52c5e17..6586f94 100644 --- a/src/test/java/CalculationsTest.java +++ b/src/test/java/CalculationsTest.java @@ -18,6 +18,19 @@ public class CalculationsTest { // Test with a large number assertEquals(1000000, calc.calculateSquare(1000)); + } + + @Test + public void testCalculateFactorial() { + Calculations fact = new Calculations(); + + // Test with positive numbers + assertEquals(1, fact.calculateFactorial(0)); + assertEquals(1, fact.calculateFactorial(1)); + assertEquals(2, fact.calculateFactorial(2)); + assertEquals(6, fact.calculateFactorial(3)); + assertEquals(24, fact.calculateFactorial(4)); + assertEquals(120, fact.calculateFactorial(5)); } }