Beispiel #1
0
 private static void MoveAndCheck(LoggingObject lo, Body box)
 {
     for (int i = 0; i < 5; i++)
     {
         box.Location = box.Location.Apply(new Frame3D(1, 1, 0));
         lo.SaveLocation(box.GetAbsoluteLocation(), _totalTime);
         Frame3D loc = lo.Movements.Last().NextLocation();
         Assert.AreEqual(box.GetAbsoluteLocation(), loc);
     }
     Assert.AreEqual(_totalTime, lo.Movements[_movementCount].StartTime);
     _totalTime += 0.1;
     _movementCount++;
     Assert.AreEqual(_movementCount, lo.Movements.Count);
 }
Beispiel #2
0
			public void TestSaveLocation1()
			{
				var root = new Body
				           	{
				           		Location = new Frame3D(10, 0, 0)
				           	};	
				Body box = new Box
				           	{
				           		Location = new Frame3D(10, 20, 30)
				           	};
				var lo = new LoggingObject(box, root);
				Assert.AreEqual(box, lo.Body);
				MoveAndCheck(lo, box);
				//now stop
				for(int i = 0; i < 3; i++)
					lo.SaveLocation(box.GetAbsoluteLocation(), 0.1);
				Assert.AreEqual(1, lo.Movements.Count);
				//move
				MoveAndCheck(lo, box);
			}
Beispiel #3
0
            public void TestSaveLocation1()
            {
                var root = new Body
                {
                    Location = new Frame3D(10, 0, 0)
                };
                Body box = new Box
                {
                    Location = new Frame3D(10, 20, 30)
                };
                var lo = new LoggingObject(box, root);

                Assert.AreEqual(box, lo.Body);
                MoveAndCheck(lo, box);
                //now stop
                for (int i = 0; i < 3; i++)
                {
                    lo.SaveLocation(box.GetAbsoluteLocation(), 0.1);
                }
                Assert.AreEqual(1, lo.Movements.Count);
                //move
                MoveAndCheck(lo, box);
            }
Beispiel #4
0
			private static void MoveAndCheck(LoggingObject lo, Body box)
			{
				for(int i = 0; i < 5; i++)
				{
					box.Location = box.Location.Apply(new Frame3D(1, 1, 0));
					lo.SaveLocation(box.GetAbsoluteLocation(), _totalTime);
					Frame3D loc = lo.Movements.Last().NextLocation();
					Assert.AreEqual(box.GetAbsoluteLocation(), loc);
				}
				Assert.AreEqual(_totalTime, lo.Movements[_movementCount].StartTime);
				_totalTime += 0.1;
				_movementCount++;
				Assert.AreEqual(_movementCount, lo.Movements.Count);
			}