diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 9c66b25..d507822 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
109 | afm.SetAppearance(sp, originalTe, null); | 109 | afm.SetAppearance(sp, originalTe, null); |
110 | 110 | ||
111 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 111 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
112 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance); | 112 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance); |
113 | 113 | ||
114 | ScenePresence npc = scene.GetScenePresence(npcId); | 114 | ScenePresence npc = scene.GetScenePresence(npcId); |
115 | 115 | ||
@@ -119,6 +119,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
119 | } | 119 | } |
120 | 120 | ||
121 | [Test] | 121 | [Test] |
122 | public void TestRemove() | ||
123 | { | ||
124 | TestHelpers.InMethod(); | ||
125 | // log4net.Config.XmlConfigurator.Configure(); | ||
126 | |||
127 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); | ||
128 | // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); | ||
129 | |||
130 | Vector3 startPos = new Vector3(128, 128, 30); | ||
131 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | ||
132 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); | ||
133 | |||
134 | npcModule.DeleteNPC(npcId, scene); | ||
135 | |||
136 | ScenePresence deletedNpc = scene.GetScenePresence(npcId); | ||
137 | |||
138 | Assert.That(deletedNpc, Is.Null); | ||
139 | } | ||
140 | |||
141 | [Test] | ||
122 | public void TestAttachments() | 142 | public void TestAttachments() |
123 | { | 143 | { |
124 | TestHelpers.InMethod(); | 144 | TestHelpers.InMethod(); |
@@ -137,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
137 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); | 157 | am.RezSingleAttachmentFromInventory(sp, attItemId, (uint)AttachmentPoint.Chest); |
138 | 158 | ||
139 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 159 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
140 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance); | 160 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance); |
141 | 161 | ||
142 | ScenePresence npc = scene.GetScenePresence(npcId); | 162 | ScenePresence npc = scene.GetScenePresence(npcId); |
143 | 163 | ||
@@ -169,7 +189,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
169 | 189 | ||
170 | Vector3 startPos = new Vector3(128, 128, 30); | 190 | Vector3 startPos = new Vector3(128, 128, 30); |
171 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 191 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
172 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 192 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
173 | 193 | ||
174 | ScenePresence npc = scene.GetScenePresence(npcId); | 194 | ScenePresence npc = scene.GetScenePresence(npcId); |
175 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); | 195 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); |
@@ -240,7 +260,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
240 | 260 | ||
241 | Vector3 startPos = new Vector3(128, 128, 30); | 261 | Vector3 startPos = new Vector3(128, 128, 30); |
242 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 262 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
243 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 263 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
244 | 264 | ||
245 | ScenePresence npc = scene.GetScenePresence(npcId); | 265 | ScenePresence npc = scene.GetScenePresence(npcId); |
246 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 266 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |
@@ -273,7 +293,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
273 | Vector3 startPos = new Vector3(1, 1, 1); | 293 | Vector3 startPos = new Vector3(1, 1, 1); |
274 | 294 | ||
275 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 295 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
276 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | 296 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, UUID.Zero, true, scene, sp.Appearance); |
277 | 297 | ||
278 | ScenePresence npc = scene.GetScenePresence(npcId); | 298 | ScenePresence npc = scene.GetScenePresence(npcId); |
279 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 299 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |