RobotFactory JUnit Test hinzugefügt
parent
c2e4d8ab2a
commit
29004a278d
|
@ -0,0 +1,19 @@
|
||||||
|
package main;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import domain.RobotType;
|
||||||
|
|
||||||
|
class RobotFactoryTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testRobotFactory() {
|
||||||
|
assertEquals(10000, RobotFactory.robotFactory(RobotType.C3PO, "Test").getId());
|
||||||
|
assertEquals("Test", RobotFactory.robotFactory(RobotType.C3PO, "Test").getName());
|
||||||
|
assertEquals(0, RobotFactory.robotFactory(RobotType.R2D2, "Tes2t").getId());
|
||||||
|
assertEquals("Test2", RobotFactory.robotFactory(RobotType.R2D2, "Test2").getName());
|
||||||
|
assertTrue(RobotFactory.robotFactory(RobotType.NEXUS6, "Tes2t") == null);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue