aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
diff options
context:
space:
mode:
authorMelanie2011-10-25 02:26:56 +0100
committerMelanie2011-10-25 02:26:56 +0100
commite2de57ca29116fd1dae77065104d7f431da711fc (patch)
treead5ed1720690812044cbfc7fb6072283b4e144c7 /OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
parentMerge commit '730460169f2a45e934b42b2464f7c7472f7fac48' into bigmerge (diff)
parentImplement osNpcSit(). This is still in development so don't trust it (diff)
downloadopensim-SC-e2de57ca29116fd1dae77065104d7f431da711fc.zip
opensim-SC-e2de57ca29116fd1dae77065104d7f431da711fc.tar.gz
opensim-SC-e2de57ca29116fd1dae77065104d7f431da711fc.tar.bz2
opensim-SC-e2de57ca29116fd1dae77065104d7f431da711fc.tar.xz
Merge commit '0c041ce12f393367e2754e88d9b8dad5e45f88c4' into bigmerge
Conflicts: OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 49c06bc..c5be0b6 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -229,5 +229,29 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
229 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on second move"); 229 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on second move");
230 Assert.That(npc.AbsolutePosition, Is.EqualTo(targetPos)); 230 Assert.That(npc.AbsolutePosition, Is.EqualTo(targetPos));
231 } 231 }
232
233 [Test]
234 public void TestSit()
235 {
236 TestHelpers.InMethod();
237// log4net.Config.XmlConfigurator.Configure();
238
239 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
240
241 Vector3 startPos = new Vector3(128, 128, 30);
242 INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
243 UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance);
244
245 ScenePresence npc = scene.GetScenePresence(npcId);
246 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
247
248 // We must have a non Vector3.Zero sit target position otherwise part.SitTargetAvatar doesn't get set!
249 part.SitTargetPosition = new Vector3(0, 0, 1);
250 npcModule.Sit(npc.UUID, part.UUID, scene);
251
252 // Assertions?
253 Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId));
254 Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
255 }
232 } 256 }
233} \ No newline at end of file 257} \ No newline at end of file