diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | 449 |
1 files changed, 449 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs new file mode 100644 index 0000000..162a0c3 --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | |||
@@ -0,0 +1,449 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net.Config; | ||
32 | using Nini.Config; | ||
33 | using NUnit.Framework; | ||
34 | using OpenMetaverse; | ||
35 | using OpenMetaverse.Assets; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; | ||
38 | using OpenSim.Region.Framework.Interfaces; | ||
39 | using OpenSim.Region.Framework.Scenes; | ||
40 | using OpenSim.Services.Interfaces; | ||
41 | using OpenSim.Tests.Common; | ||
42 | using OpenSim.Tests.Common.Mock; | ||
43 | |||
44 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | ||
45 | { | ||
46 | [TestFixture] | ||
47 | public class InventoryTransferModuleTests : OpenSimTestCase | ||
48 | { | ||
49 | protected TestScene m_scene; | ||
50 | |||
51 | [SetUp] | ||
52 | public override void SetUp() | ||
53 | { | ||
54 | base.SetUp(); | ||
55 | |||
56 | IConfigSource config = new IniConfigSource(); | ||
57 | config.AddConfig("Messaging"); | ||
58 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); | ||
59 | |||
60 | m_scene = new SceneHelpers().SetupScene(); | ||
61 | SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); | ||
62 | } | ||
63 | |||
64 | [Test] | ||
65 | public void TestAcceptGivenItem() | ||
66 | { | ||
67 | // TestHelpers.EnableLogging(); | ||
68 | |||
69 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | ||
70 | UUID itemId = TestHelpers.ParseTail(0x100); | ||
71 | UUID assetId = TestHelpers.ParseTail(0x200); | ||
72 | |||
73 | UserAccount ua1 | ||
74 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | ||
75 | UserAccount ua2 | ||
76 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | ||
77 | |||
78 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | ||
79 | TestClient giverClient = (TestClient)giverSp.ControllingClient; | ||
80 | |||
81 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | ||
82 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | ||
83 | |||
84 | // Create the object to test give | ||
85 | InventoryItemBase originalItem | ||
86 | = UserInventoryHelpers.CreateInventoryItem( | ||
87 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | ||
88 | |||
89 | byte[] giveImBinaryBucket = new byte[17]; | ||
90 | byte[] itemIdBytes = itemId.GetBytes(); | ||
91 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | ||
92 | |||
93 | GridInstantMessage giveIm | ||
94 | = new GridInstantMessage( | ||
95 | m_scene, | ||
96 | giverSp.UUID, | ||
97 | giverSp.Name, | ||
98 | receiverSp.UUID, | ||
99 | (byte)InstantMessageDialog.InventoryOffered, | ||
100 | false, | ||
101 | "inventory offered msg", | ||
102 | initialSessionId, | ||
103 | false, | ||
104 | Vector3.Zero, | ||
105 | giveImBinaryBucket, | ||
106 | true); | ||
107 | |||
108 | giverClient.HandleImprovedInstantMessage(giveIm); | ||
109 | |||
110 | // These details might not all be correct. | ||
111 | GridInstantMessage acceptIm | ||
112 | = new GridInstantMessage( | ||
113 | m_scene, | ||
114 | receiverSp.UUID, | ||
115 | receiverSp.Name, | ||
116 | giverSp.UUID, | ||
117 | (byte)InstantMessageDialog.InventoryAccepted, | ||
118 | false, | ||
119 | "inventory accepted msg", | ||
120 | initialSessionId, | ||
121 | false, | ||
122 | Vector3.Zero, | ||
123 | null, | ||
124 | true); | ||
125 | |||
126 | receiverClient.HandleImprovedInstantMessage(acceptIm); | ||
127 | |||
128 | // Test for item remaining in the giver's inventory (here we assume a copy item) | ||
129 | // TODO: Test no-copy items. | ||
130 | InventoryItemBase originalItemAfterGive | ||
131 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | ||
132 | |||
133 | Assert.That(originalItemAfterGive, Is.Not.Null); | ||
134 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | ||
135 | |||
136 | // Test for item successfully making it into the receiver's inventory | ||
137 | InventoryItemBase receivedItem | ||
138 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); | ||
139 | |||
140 | Assert.That(receivedItem, Is.Not.Null); | ||
141 | Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID)); | ||
142 | |||
143 | // Test that on a delete, item still exists and is accessible for the giver. | ||
144 | m_scene.InventoryService.DeleteItems(receiverSp.UUID, new List<UUID>() { receivedItem.ID }); | ||
145 | |||
146 | InventoryItemBase originalItemAfterDelete | ||
147 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | ||
148 | |||
149 | Assert.That(originalItemAfterDelete, Is.Not.Null); | ||
150 | |||
151 | // TODO: Test scenario where giver deletes their item first. | ||
152 | } | ||
153 | |||
154 | /// <summary> | ||
155 | /// Test user rejection of a given item. | ||
156 | /// </summary> | ||
157 | /// <remarks> | ||
158 | /// A rejected item still ends up in the user's trash folder. | ||
159 | /// </remarks> | ||
160 | [Test] | ||
161 | public void TestRejectGivenItem() | ||
162 | { | ||
163 | // TestHelpers.EnableLogging(); | ||
164 | |||
165 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | ||
166 | UUID itemId = TestHelpers.ParseTail(0x100); | ||
167 | UUID assetId = TestHelpers.ParseTail(0x200); | ||
168 | |||
169 | UserAccount ua1 | ||
170 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | ||
171 | UserAccount ua2 | ||
172 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | ||
173 | |||
174 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | ||
175 | TestClient giverClient = (TestClient)giverSp.ControllingClient; | ||
176 | |||
177 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | ||
178 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | ||
179 | |||
180 | // Create the object to test give | ||
181 | InventoryItemBase originalItem | ||
182 | = UserInventoryHelpers.CreateInventoryItem( | ||
183 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | ||
184 | |||
185 | GridInstantMessage receivedIm = null; | ||
186 | receiverClient.OnReceivedInstantMessage += im => receivedIm = im; | ||
187 | |||
188 | byte[] giveImBinaryBucket = new byte[17]; | ||
189 | byte[] itemIdBytes = itemId.GetBytes(); | ||
190 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | ||
191 | |||
192 | GridInstantMessage giveIm | ||
193 | = new GridInstantMessage( | ||
194 | m_scene, | ||
195 | giverSp.UUID, | ||
196 | giverSp.Name, | ||
197 | receiverSp.UUID, | ||
198 | (byte)InstantMessageDialog.InventoryOffered, | ||
199 | false, | ||
200 | "inventory offered msg", | ||
201 | initialSessionId, | ||
202 | false, | ||
203 | Vector3.Zero, | ||
204 | giveImBinaryBucket, | ||
205 | true); | ||
206 | |||
207 | giverClient.HandleImprovedInstantMessage(giveIm); | ||
208 | |||
209 | // These details might not all be correct. | ||
210 | // Session ID is now the created item ID (!) | ||
211 | GridInstantMessage rejectIm | ||
212 | = new GridInstantMessage( | ||
213 | m_scene, | ||
214 | receiverSp.UUID, | ||
215 | receiverSp.Name, | ||
216 | giverSp.UUID, | ||
217 | (byte)InstantMessageDialog.InventoryDeclined, | ||
218 | false, | ||
219 | "inventory declined msg", | ||
220 | new UUID(receivedIm.imSessionID), | ||
221 | false, | ||
222 | Vector3.Zero, | ||
223 | null, | ||
224 | true); | ||
225 | |||
226 | receiverClient.HandleImprovedInstantMessage(rejectIm); | ||
227 | |||
228 | // Test for item remaining in the giver's inventory (here we assume a copy item) | ||
229 | // TODO: Test no-copy items. | ||
230 | InventoryItemBase originalItemAfterGive | ||
231 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | ||
232 | |||
233 | Assert.That(originalItemAfterGive, Is.Not.Null); | ||
234 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | ||
235 | |||
236 | // Test for item successfully making it into the receiver's inventory | ||
237 | InventoryItemBase receivedItem | ||
238 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); | ||
239 | |||
240 | InventoryFolderBase trashFolder | ||
241 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); | ||
242 | |||
243 | Assert.That(receivedItem, Is.Not.Null); | ||
244 | Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID)); | ||
245 | Assert.That(receivedItem.Folder, Is.EqualTo(trashFolder.ID)); | ||
246 | |||
247 | // Test that on a delete, item still exists and is accessible for the giver. | ||
248 | m_scene.InventoryService.PurgeFolder(trashFolder); | ||
249 | |||
250 | InventoryItemBase originalItemAfterDelete | ||
251 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | ||
252 | |||
253 | Assert.That(originalItemAfterDelete, Is.Not.Null); | ||
254 | } | ||
255 | |||
256 | [Test] | ||
257 | public void TestAcceptGivenFolder() | ||
258 | { | ||
259 | TestHelpers.InMethod(); | ||
260 | // TestHelpers.EnableLogging(); | ||
261 | |||
262 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | ||
263 | UUID folderId = TestHelpers.ParseTail(0x100); | ||
264 | |||
265 | UserAccount ua1 | ||
266 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | ||
267 | UserAccount ua2 | ||
268 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | ||
269 | |||
270 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | ||
271 | TestClient giverClient = (TestClient)giverSp.ControllingClient; | ||
272 | |||
273 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | ||
274 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | ||
275 | |||
276 | InventoryFolderBase originalFolder | ||
277 | = UserInventoryHelpers.CreateInventoryFolder( | ||
278 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | ||
279 | |||
280 | byte[] giveImBinaryBucket = new byte[17]; | ||
281 | giveImBinaryBucket[0] = (byte)AssetType.Folder; | ||
282 | byte[] itemIdBytes = folderId.GetBytes(); | ||
283 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | ||
284 | |||
285 | GridInstantMessage giveIm | ||
286 | = new GridInstantMessage( | ||
287 | m_scene, | ||
288 | giverSp.UUID, | ||
289 | giverSp.Name, | ||
290 | receiverSp.UUID, | ||
291 | (byte)InstantMessageDialog.InventoryOffered, | ||
292 | false, | ||
293 | "inventory offered msg", | ||
294 | initialSessionId, | ||
295 | false, | ||
296 | Vector3.Zero, | ||
297 | giveImBinaryBucket, | ||
298 | true); | ||
299 | |||
300 | giverClient.HandleImprovedInstantMessage(giveIm); | ||
301 | |||
302 | // These details might not all be correct. | ||
303 | GridInstantMessage acceptIm | ||
304 | = new GridInstantMessage( | ||
305 | m_scene, | ||
306 | receiverSp.UUID, | ||
307 | receiverSp.Name, | ||
308 | giverSp.UUID, | ||
309 | (byte)InstantMessageDialog.InventoryAccepted, | ||
310 | false, | ||
311 | "inventory accepted msg", | ||
312 | initialSessionId, | ||
313 | false, | ||
314 | Vector3.Zero, | ||
315 | null, | ||
316 | true); | ||
317 | |||
318 | receiverClient.HandleImprovedInstantMessage(acceptIm); | ||
319 | |||
320 | // Test for item remaining in the giver's inventory (here we assume a copy item) | ||
321 | // TODO: Test no-copy items. | ||
322 | InventoryFolderBase originalFolderAfterGive | ||
323 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | ||
324 | |||
325 | Assert.That(originalFolderAfterGive, Is.Not.Null); | ||
326 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | ||
327 | |||
328 | // Test for item successfully making it into the receiver's inventory | ||
329 | InventoryFolderBase receivedFolder | ||
330 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); | ||
331 | |||
332 | Assert.That(receivedFolder, Is.Not.Null); | ||
333 | Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID)); | ||
334 | |||
335 | // Test that on a delete, item still exists and is accessible for the giver. | ||
336 | m_scene.InventoryService.DeleteFolders(receiverSp.UUID, new List<UUID>() { receivedFolder.ID }); | ||
337 | |||
338 | InventoryFolderBase originalFolderAfterDelete | ||
339 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | ||
340 | |||
341 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | ||
342 | |||
343 | // TODO: Test scenario where giver deletes their item first. | ||
344 | } | ||
345 | |||
346 | /// <summary> | ||
347 | /// Test user rejection of a given item. | ||
348 | /// </summary> | ||
349 | /// <remarks> | ||
350 | /// A rejected item still ends up in the user's trash folder. | ||
351 | /// </remarks> | ||
352 | [Test] | ||
353 | public void TestRejectGivenFolder() | ||
354 | { | ||
355 | TestHelpers.InMethod(); | ||
356 | // TestHelpers.EnableLogging(); | ||
357 | |||
358 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | ||
359 | UUID folderId = TestHelpers.ParseTail(0x100); | ||
360 | |||
361 | UserAccount ua1 | ||
362 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | ||
363 | UserAccount ua2 | ||
364 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | ||
365 | |||
366 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | ||
367 | TestClient giverClient = (TestClient)giverSp.ControllingClient; | ||
368 | |||
369 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | ||
370 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | ||
371 | |||
372 | // Create the folder to test give | ||
373 | InventoryFolderBase originalFolder | ||
374 | = UserInventoryHelpers.CreateInventoryFolder( | ||
375 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | ||
376 | |||
377 | GridInstantMessage receivedIm = null; | ||
378 | receiverClient.OnReceivedInstantMessage += im => receivedIm = im; | ||
379 | |||
380 | byte[] giveImBinaryBucket = new byte[17]; | ||
381 | giveImBinaryBucket[0] = (byte)AssetType.Folder; | ||
382 | byte[] itemIdBytes = folderId.GetBytes(); | ||
383 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | ||
384 | |||
385 | GridInstantMessage giveIm | ||
386 | = new GridInstantMessage( | ||
387 | m_scene, | ||
388 | giverSp.UUID, | ||
389 | giverSp.Name, | ||
390 | receiverSp.UUID, | ||
391 | (byte)InstantMessageDialog.InventoryOffered, | ||
392 | false, | ||
393 | "inventory offered msg", | ||
394 | initialSessionId, | ||
395 | false, | ||
396 | Vector3.Zero, | ||
397 | giveImBinaryBucket, | ||
398 | true); | ||
399 | |||
400 | giverClient.HandleImprovedInstantMessage(giveIm); | ||
401 | |||
402 | // These details might not all be correct. | ||
403 | // Session ID is now the created item ID (!) | ||
404 | GridInstantMessage rejectIm | ||
405 | = new GridInstantMessage( | ||
406 | m_scene, | ||
407 | receiverSp.UUID, | ||
408 | receiverSp.Name, | ||
409 | giverSp.UUID, | ||
410 | (byte)InstantMessageDialog.InventoryDeclined, | ||
411 | false, | ||
412 | "inventory declined msg", | ||
413 | new UUID(receivedIm.imSessionID), | ||
414 | false, | ||
415 | Vector3.Zero, | ||
416 | null, | ||
417 | true); | ||
418 | |||
419 | receiverClient.HandleImprovedInstantMessage(rejectIm); | ||
420 | |||
421 | // Test for item remaining in the giver's inventory (here we assume a copy item) | ||
422 | // TODO: Test no-copy items. | ||
423 | InventoryFolderBase originalFolderAfterGive | ||
424 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | ||
425 | |||
426 | Assert.That(originalFolderAfterGive, Is.Not.Null); | ||
427 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | ||
428 | |||
429 | // Test for folder successfully making it into the receiver's inventory | ||
430 | InventoryFolderBase receivedFolder | ||
431 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); | ||
432 | |||
433 | InventoryFolderBase trashFolder | ||
434 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); | ||
435 | |||
436 | Assert.That(receivedFolder, Is.Not.Null); | ||
437 | Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID)); | ||
438 | Assert.That(receivedFolder.ParentID, Is.EqualTo(trashFolder.ID)); | ||
439 | |||
440 | // Test that on a delete, item still exists and is accessible for the giver. | ||
441 | m_scene.InventoryService.PurgeFolder(trashFolder); | ||
442 | |||
443 | InventoryFolderBase originalFolderAfterDelete | ||
444 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | ||
445 | |||
446 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | ||
447 | } | ||
448 | } | ||
449 | } \ No newline at end of file | ||