I developed a game in Java and I have to do unit tests on it. I do them and I get an error in the tests but I don't understand why, if the game works as expected. The test code is as follows:
package Frames;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Daniel
*/
public class ConstelacionTest {
public ConstelacionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of Mensaje method, of class Constelacion.
*/
@Test
public void testMensaje() {
System.out.println("Mensaje");
Constelacion instance = new Constelacion();
instance.Mensaje();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of CleanBoton method, of class Constelacion.
*/
@Test
public void testCleanBoton() {
System.out.println("CleanBoton");
Constelacion instance = new Constelacion();
instance.CleanBoton();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of main method, of class Constelacion.
*/
@Test
public void testMain() {
System.out.println("main");
String[] args = null;
Constelacion.main(args);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
And when I run it I get this error in the tests. Could someone tell me why the result is wrong?
Easy, eliminate the fail of the methods as indicated in the comments of the code