FactorialTest.java 544B

12345678910111213141516171819202122232425262728293031
  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. }