aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index afcf05a..afa61bc 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -147,6 +147,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
147 } 147 }
148 148
149 [Test] 149 [Test]
150 public void TestDetachAttachmentToScene()
151 {
152 TestHelpers.InMethod();
153 log4net.Config.XmlConfigurator.Configure();
154
155 UUID userId = TestHelpers.ParseTail(0x1);
156 UUID attItemId = TestHelpers.ParseTail(0x2);
157 UUID attAssetId = TestHelpers.ParseTail(0x3);
158 string attName = "att";
159
160 UserAccountHelpers.CreateUserWithInventory(scene, userId);
161 ScenePresence presence = SceneHelpers.AddScenePresence(scene, userId);
162 InventoryItemBase attItem
163 = UserInventoryHelpers.CreateInventoryItem(
164 scene, attName, attItemId, attAssetId, userId, InventoryType.Object);
165
166 UUID attSoId = m_attMod.RezSingleAttachmentFromInventory(
167 presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest);
168 m_attMod.DetachSingleAttachmentToGround(attSoId, presence.ControllingClient);
169
170 // Check status on scene presence
171 Assert.That(presence.HasAttachments(), Is.False);
172 List<SceneObjectGroup> attachments = presence.Attachments;
173 Assert.That(attachments.Count, Is.EqualTo(0));
174
175 // Check item status
176 Assert.That(scene.InventoryService.GetItem(new InventoryItemBase(attItemId)), Is.Null);
177
178 // Check object in scene
179 Assert.That(scene.GetSceneObjectGroup("att"), Is.Not.Null);
180 }
181
182 [Test]
150 public void TestDetachAttachmentToInventory() 183 public void TestDetachAttachmentToInventory()
151 { 184 {
152 TestHelpers.InMethod(); 185 TestHelpers.InMethod();