|
@@ -0,0 +1,41 @@
|
|
|
+package tests;
|
|
|
+
|
|
|
+import static org.junit.Assert.*;
|
|
|
+
|
|
|
+import org.junit.Before;
|
|
|
+import org.junit.Test;
|
|
|
+
|
|
|
+import classes.HolonObject;
|
|
|
+import classes.HolonSwitch;
|
|
|
+import ui.controller.CategoryController;
|
|
|
+import ui.controller.MultiPurposeController;
|
|
|
+import ui.model.Model;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+public class praktiumHolonTestCategoryController {
|
|
|
+
|
|
|
+ protected praktiumHolonTestCategoryController adapter;
|
|
|
+ protected Model model;
|
|
|
+ protected MultiPurposeController mp;
|
|
|
+ protected CategoryController controller;
|
|
|
+
|
|
|
+ @Before
|
|
|
+ public void setUp() {
|
|
|
+ adapter = new praktiumHolonTestCategoryController();
|
|
|
+ model = new Model();
|
|
|
+ mp = new MultiPurposeController(model);
|
|
|
+ controller = new CategoryController(model, mp);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testInitialCategories() {
|
|
|
+ assertTrue("Number of Categories is not 3", model.getCategories().size() == 3);
|
|
|
+ assertTrue("Second Category is not Building", model.getCategories().get(1).getName().equals("Building"));
|
|
|
+ assertTrue("Category Building is Empty", !model.getCategories().get(1).getObjects().isEmpty());
|
|
|
+ assertEquals("Object is not a Power Plant", model.getCategories().get(0).getObjects().get(0).getObjName(), "Power Plant");
|
|
|
+ assertFalse("A Switch should not be a Holon Object", model.getCategories().get(2).getObjects().get(1) instanceof HolonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|