Skip to content

Instantly share code, notes, and snippets.

@gonzalezgarciacristian
Last active March 8, 2017 11:07
Show Gist options
  • Save gonzalezgarciacristian/b1ff99c999044c6fe4fe9db1f81ad7b9 to your computer and use it in GitHub Desktop.
Save gonzalezgarciacristian/b1ff99c999044c6fe4fe9db1f81ad7b9 to your computer and use it in GitHub Desktop.
package tests;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import main.Operaciones;
import static org.junit.Assert.*;
public class EvenFactorialTestsUnit {
Operaciones operacion;
public EvenFactorialTestsUnit() {
operacion = new Operaciones();
}
@Test
public void testEven1() {
assertTrue(operacion.even(4));
}
@Test
public void testEven2() {
assertFalse(operacion.even(5));
}
@Test
public void testEven_3() {
assertTrue(operacion.even(20));
}
@Test
public void testEven4() {
assertFalse(operacion.even(51));
}
@Test
public void testEven5() {
assertFalse(operacion.even(1013));
}
@Test
public void testFactorial1() {
assertEquals(operacion.factorial(0), 1);
}
@Test
public void testFactorial2() {
assertEquals(operacion.factorial(1), 1);
}
@Test
public void testFactorial3() {
assertEquals(operacion.factorial(5), 120);
}
@Test
public void testFactorial4() {
assertEquals(operacion.factorial(10), 3628800);
}
@Test
public void testFactorial5() {
assertEquals(operacion.factorial(12), 479001600);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment