Error in unit tests

0

I developed a game in Java and I have to do unit tests. I do them and I get an error in the tests but I do not 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. Can someone tell me why the result is wrong?

    
asked by paola 25.07.2017 в 06:04
source

1 answer

2

Easy, eliminate the fail of the methods as indicated by the comments in the code

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

    /**
     * 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.
    }

    /**
     * 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.
    }

}
    
answered by 25.07.2017 / 07:40
source