diff --git a/src/test/java/CalculationsTest.java b/src/test/java/CalculationsTest.java index 634a972..1073c19 100644 --- a/src/test/java/CalculationsTest.java +++ b/src/test/java/CalculationsTest.java @@ -35,5 +35,11 @@ public class CalculationsTest { // Test with large number assertEquals(3628800, fact.calculateFactorial(10)); } + + @Test(expected = IllegalArgumentException.class) + public void testNegativeNumber() { + Calculations fact = new Calculations(); + fact.calculateFactorial(-5); // Should throw IllegalArgumentException + } }