Teh-Hai Julian Zheng 8 năm trước cách đây
mục cha
commit
492bf37c27

+ 0 - 22
src/tests/Tests1.java

@@ -1,22 +0,0 @@
-package tests;
-
-/**
- * First round of tests
- *
- */
-
-public class Tests1 {
-	
-	/**
-	 * Create some CPS object and Gadgets
-	 */
-	public static void main(String[] args) {
-		// HolonObject b1 = new HolonObject();
-		// HolonObject b2 = new HolonObject();
-		// HolonSwitch s1 = new HolonSwitch();
-		// HolonTransformer t1 = new HolonTransformer();
-		// b1.setPos(20, 30);
-		// Position p = b1.getPos();
-		// System.out.println(p.x + "," + p.y);
-	}
-}

+ 0 - 15
src/tests/praktikumHolonsTestMinimal.java

@@ -1,15 +0,0 @@
-package tests;
-
-public class praktikumHolonsTestMinimal {
-
-	
-	//@Before
-	public void setup(){
-		
-	}
-	
-	//@Test
-	
-
-
-}

+ 41 - 0
src/tests/praktiumHolonTestCategoryController.java

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