diff options
author | Justin Clark-Casey (justincc) | 2011-08-26 22:17:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-26 22:17:05 +0100 |
commit | 1dba047e4d4be6213cfade45630f2b906a5a5755 (patch) | |
tree | a4b49feab64a24353070fda2612ce833e1faa911 | |
parent | refactor: move sog.DetachToInventoryPrep() into AttachmentsModule.DetachSingl... (diff) | |
download | opensim-SC-1dba047e4d4be6213cfade45630f2b906a5a5755.zip opensim-SC-1dba047e4d4be6213cfade45630f2b906a5a5755.tar.gz opensim-SC-1dba047e4d4be6213cfade45630f2b906a5a5755.tar.bz2 opensim-SC-1dba047e4d4be6213cfade45630f2b906a5a5755.tar.xz |
add regression test for detaching an attachment to the scene
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 33 |
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(); |