RobotFactory JUnit Test hinzugefügt

RobotFactory_Test
nico 2023-01-08 20:23:36 +01:00
parent c2e4d8ab2a
commit 29004a278d
1 changed files with 19 additions and 0 deletions

View File

@ -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);
}
}