|
|
@ -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)); |
|
|
|
|
|
|
|
} |
|
|
|
} |