diff --git a/out/production/Robot_Factory_PR/classpath.index b/out/production/Robot_Factory_PR/classpath.index new file mode 100644 index 0000000..699ea37 Binary files /dev/null and b/out/production/Robot_Factory_PR/classpath.index differ diff --git a/out/production/Robot_Factory_PR/src/utility/robot_exceptions/robotExceptions.class b/out/production/Robot_Factory_PR/src/utility/robot_exceptions/robotExceptions.class index 3cc34b6..383554b 100644 Binary files a/out/production/Robot_Factory_PR/src/utility/robot_exceptions/robotExceptions.class and b/out/production/Robot_Factory_PR/src/utility/robot_exceptions/robotExceptions.class differ diff --git a/out/production/Robot_Factory_PR/tests/tests/C3POTest.class b/out/production/Robot_Factory_PR/tests/tests/C3POTest.class index f2b3d23..775977b 100644 Binary files a/out/production/Robot_Factory_PR/tests/tests/C3POTest.class and b/out/production/Robot_Factory_PR/tests/tests/C3POTest.class differ diff --git a/out/production/Robot_Factory_PR/tests/tests/FactoryTest.class b/out/production/Robot_Factory_PR/tests/tests/FactoryTest.class new file mode 100644 index 0000000..eeca4bd Binary files /dev/null and b/out/production/Robot_Factory_PR/tests/tests/FactoryTest.class differ diff --git a/out/production/Robot_Factory_PR/tests/tests/R2D2Test.class b/out/production/Robot_Factory_PR/tests/tests/R2D2Test.class index 65e1775..6ffc274 100644 Binary files a/out/production/Robot_Factory_PR/tests/tests/R2D2Test.class and b/out/production/Robot_Factory_PR/tests/tests/R2D2Test.class differ diff --git a/src/domain/Factory.java b/src/domain/Factory.java index 3b02a16..ffd55ba 100644 --- a/src/domain/Factory.java +++ b/src/domain/Factory.java @@ -11,7 +11,6 @@ public class Factory implements Serializable { private int r2d2ID = 10000; public Factory(){ - } /** * @return Collection diff --git a/tests/tests/FactoryTest.java b/tests/tests/FactoryTest.java index 5041cf4..fda00c3 100644 --- a/tests/tests/FactoryTest.java +++ b/tests/tests/FactoryTest.java @@ -1,26 +1,41 @@ package tests; +import domain.Robot; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import domain.C3PO; +import domain.Factory; +import domain.RobotType; import static org.junit.jupiter.api.Assertions.*; class FactoryTest { - @Test - void robotListToCollection() { - + Factory f; + @BeforeEach + void setup(){ + f = new Factory(); + f.buildNewRobot("herbi", RobotType.C3PO); + f.buildNewRobot("Herta", RobotType.R2D2); } @Test void getRobotList() { - + assertEquals(2, f.getRobotList().length); + f.buildNewRobot("Herbi3", RobotType.C3PO); + assertEquals(3, f.getRobotList().length); } @Test void buildNewRobot() { + boolean test = f.buildNewRobot("herbi", RobotType.R2D2); + assertEquals(true, test); + } @Test void getRobotOfList() { + Robot r = f.getRobotOfList(0); + assertEquals( "herbi",r.getName()); } } \ No newline at end of file