admin管理员组文章数量:1391850
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
}
}
本文标签:
版权声明:本文标题:java - Im trying to execute Junit tests in a group project but this error doesnt stop to appear in eclipse console: - Stack Over 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744770815a2624326.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论