From 31cea17f8e7995277008370738be1d510dfede7a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Aug 2011 23:13:52 +0100 Subject: extend move test to check avatar is moving in the right direction after setting a move target --- .../OptionalModules/World/NPC/Tests/NPCModuleTests.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 4e2b5f1..512405a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs @@ -112,6 +112,19 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests scene.Update(); Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); + Vector3 targetPos = new Vector3(128, 128, 40); + npcModule.Autopilot(npc.UUID, scene, targetPos); + + Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); + + scene.Update(); + + // We should really check the exact figure. + Assert.That(npc.AbsolutePosition.X, Is.EqualTo(startPos.X)); + Assert.That(npc.AbsolutePosition.Y, Is.EqualTo(startPos.Y)); + Assert.That(npc.AbsolutePosition.Z, Is.GreaterThan(startPos.Z)); + Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.Z)); + // Not yet complete } } -- cgit v1.1