Add some unit tests for Node.within
authorAndy Allan <gravitystorm@gmail.com>
Tue, 14 Dec 2010 12:13:44 +0000 (12:13 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 14 Dec 2010 12:13:44 +0000 (12:13 +0000)
tests/src/net/systemeD/halcyon/connection/NodeTest.as

index b7eacff..9524b16 100644 (file)
@@ -25,6 +25,16 @@ package net.systemeD.halcyon.connection {
           Assert.assertEquals(n.lat, 14);
           Assert.assertEquals(n.lon, 41);
       }
-     
+
+      [Test]
+      public function within():void {
+          var n:Node = new Node(1,1,{},true,5,10);
+          Assert.assertTrue(n.within(9,11,6,4));
+          Assert.assertFalse(n.within(9,11,1,2));
+          Assert.assertFalse(n.within(11,12,6,4));
+          n.remove(function(action:UndoableAction):void { action.doAction(); });
+          Assert.assertFalse(n.within(9,11,6,4));
+      }
+
     }
 }