Skip to content
Snippets Groups Projects
Commit 92ba293f authored by massat's avatar massat
Browse files

Simplification des tests unitaires.

parent b0324b4d
No related branches found
No related tags found
No related merge requests found
package elevator;
import static elevator.IElevator.State.ERROR;
import static elevator.IElevator.State.UP;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class TestAutomaticElevatorSimple {
@Test
public void testAutomaticElevator() throws Exception {
// 3 étages en mode automatique
var e = new ElevatorSimulator(3, false);
// activer la montée
e.up();
// surveiller l'évolution de l'ascenseur
while (e.getState() == UP) {
System.out.printf("level = %3.2f\n", e.getLevel());
Thread.sleep(100);
}
e.stopSimulator();
// l'ascenseur est au 4ème
assertEquals(3.0, e.getLevel());
// l'ascenseur est à l'arret
assertEquals(ERROR, e.getState());
// les étapes
// assertEquals("à déterminer", e.getEvents());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment