Exemplo n.º 1
0
        public void AddMoveTrackerTest()
        {
            RoomMap map = new RoomMap(100, 100);
            Assert.AreEqual(100, map.Length);
            Assert.AreEqual(100, map.Width);
            Assert.IsFalse(map.MoveTracker("tracker1", new Point3D(5, 0, 5), 45));

            Assert.IsFalse(map.AddTracker("tracker1", new Point3D(-5, 0, 5), 45));
            Assert.IsFalse(map.AddTracker("tracker1", new Point3D(5, 0, -5), 45));
            Assert.IsFalse(map.AddTracker("tracker1", new Point3D(200, 0, 5), 45));
            Assert.IsFalse(map.AddTracker("tracker1", new Point3D(5, 0, 200), 45));

            map.AddTracker("tracker1", new Point3D(5, 0, 5), 45);
            Assert.AreEqual(new Point3D(5, 0, 5), map.TrackerList.Values.ElementAt(0).TrackerPos);
            Assert.AreEqual(45, map.TrackerList.Values.ElementAt(0).AngleOffset);
            Assert.IsFalse(map.AddTracker("tracker1", new Point3D(0, 0, 0), 0));

            map.MoveTracker("tracker1", new Point3D(10, 0, 5), 60);
            Assert.AreEqual(new Point3D(10, 0, 5), map.TrackerList.Values.ElementAt(0).TrackerPos);
            Assert.AreEqual(60, map.TrackerList.Values.ElementAt(0).AngleOffset);
        }