FactorialTest.java 533B

1234567891011121314151617181920212223242526272829
  1. import org.junit.Assert;
  2. import org.junit.Before;
  3. import org.junit.Test;
  4. import java.math.BigInteger;
  5. public class FactorialTest {
  6. private Factorial factorial;
  7. @Before
  8. public void setUp(){
  9. factorial = new Factorial();
  10. }
  11. @Test
  12. public void factorialOfTest(){
  13. //:Given
  14. BigInteger expected = new BigInteger("24");
  15. //:When
  16. BigInteger actual = factorial.factorialOf(4);
  17. //:Then
  18. Assert.assertEquals("Values should be equal", expected, actual);
  19. }
  20. }