Add the first test for JoinNodeAction
authorAndy Allan <gravitystorm@gmail.com>
Tue, 14 Dec 2010 12:57:32 +0000 (12:57 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 14 Dec 2010 12:57:32 +0000 (12:57 +0000)
tests/src/AllHalcyonTests.as
tests/src/net/systemeD/halcyon/connection/actions/JoinNodeActionTest.as [new file with mode: 0644]

index a4507fd..10ee3dd 100644 (file)
@@ -1,12 +1,14 @@
 package {
 
     import net.systemeD.halcyon.connection.NodeTest;
+    import net.systemeD.halcyon.connection.actions.JoinNodeActionTest;
 
     [Suite]
     [RunWith("org.flexunit.runners.Suite")]
     public class AllHalcyonTests {
 
-       public var nodeTest:NodeTest;
+        public var nodeTest:NodeTest;
+        public var joinNodeActionTest:JoinNodeActionTest;
 
     }
 }
diff --git a/tests/src/net/systemeD/halcyon/connection/actions/JoinNodeActionTest.as b/tests/src/net/systemeD/halcyon/connection/actions/JoinNodeActionTest.as
new file mode 100644 (file)
index 0000000..f8c6f11
--- /dev/null
@@ -0,0 +1,21 @@
+package net.systemeD.halcyon.connection.actions {
+
+    import org.flexunit.Assert;
+    import net.systemeD.halcyon.connection.actions.JoinNodeAction;
+    import net.systemeD.halcyon.connection.Node;
+    import net.systemeD.halcyon.connection.UndoableAction;
+
+    public class JoinNodeActionTest {
+
+        [Test]
+        public function joinTwoNodes():void {
+            var n:Node = new Node(1,1,{},true,5,10);
+            var n1:Node = new Node(2,1,{},true,5,10);
+            var action:UndoableAction = new JoinNodeAction(n, [n1], []);
+            action.doAction();
+            Assert.assertFalse(n.isDeleted());
+            Assert.assertTrue(n1.isDeleted());
+        }
+
+    }
+}
\ No newline at end of file