java - Im trying to execute Junit tests in a group project but this error doesnt stop to appear in eclipse console: - Stack Over

Error in question:I have tried to uninstall and install again eclipse, uninstalled and installed the Ju

Error in question:

I have tried to uninstall and install again eclipse, uninstalled and installed the Junit 5 library, and Restart Eclipse

By the way Im using Eclipse IDE for Java Developers Version: 2024-12 (4.34.0)

This is the code of the test class

package ProyectoSupervivencia;


import static .junit.jupiter.api.Assertions.assertTrue;
import .junit.jupiter.api.Test;


public class pruebas {
    private Jugador jugador;


    @Test
    public void testDescansarConAgua() {
        jugador.getAlimentos()[0] = 1; // Agua disponible
        int sedInicial = jugador.getSalud();
        jugador.descansar(8);
        assertTrue(jugador.getSalud() > sedInicial); // Debe aumentar la sed
    }

    @Test
    public void testDescansarSinAgua() {
        jugador.getAlimentos()[0] = 0; // Sin agua
        int saludInicial = jugador.getSalud();
        jugador.descansar(8);
        assertTrue(jugador.getSalud() < saludInicial); // Salud debe disminuir
    }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744770816a4592746.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信