Skip to content

Commit 41789a3

Browse files
committed
test: final fix for FactorialTest logic and formatting
1 parent ced4cfb commit 41789a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/java/com/thealgorithms/maths/FactorialTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import static org.junit.jupiter.api.Assertions.assertEquals;
44
import static org.junit.jupiter.api.Assertions.assertThrows;
55

6+
import java.math.BigInteger;
7+
68
import org.junit.jupiter.api.Test;
79

810
public class FactorialTest {
@@ -16,9 +18,9 @@ public void testWhenInvalidInoutProvidedShouldThrowException() {
1618

1719
@Test
1820
public void testCorrectFactorialCalculation() {
19-
assertEquals(1, Factorial.factorial(0));
20-
assertEquals(1, Factorial.factorial(1));
21-
assertEquals(120, Factorial.factorial(5));
22-
assertEquals(3628800, Factorial.factorial(10));
21+
assertEquals(BigInteger.ONE, Factorial.factorial(0));
22+
assertEquals(BigInteger.ONE, Factorial.factorial(1));
23+
assertEquals(BigInteger.valueOf(120), Factorial.factorial(5));
24+
assertEquals(BigInteger.valueOf(3628800), Factorial.factorial(10));
2325
}
2426
}

0 commit comments

Comments
 (0)