diff options
author | Diva Canto | 2017-05-01 16:49:42 -0700 |
---|---|---|
committer | Diva Canto | 2017-05-01 16:49:42 -0700 |
commit | 9c82ff76730c9eff80cace1ddece0148d8d0a7ee (patch) | |
tree | 0dda87eac67e84218d16a66f137459e1b2d1bf84 /OpenSim | |
parent | Added some indirect transfer tests -- Take Copy by another avatar (diff) | |
download | opensim-SC-9c82ff76730c9eff80cace1ddece0148d8d0a7ee.zip opensim-SC-9c82ff76730c9eff80cace1ddece0148d8d0a7ee.tar.gz opensim-SC-9c82ff76730c9eff80cace1ddece0148d8d0a7ee.tar.bz2 opensim-SC-9c82ff76730c9eff80cace1ddece0148d8d0a7ee.tar.xz |
Shuffle some code around
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Tests/Permissions/Common.cs | 20 | ||||
-rw-r--r-- | OpenSim/Tests/Permissions/DirectTransferTests.cs | 1 | ||||
-rw-r--r-- | OpenSim/Tests/Permissions/IndirectTransferTests.cs | 16 |
3 files changed, 22 insertions, 15 deletions
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index e62991b..f93c120 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs | |||
@@ -286,6 +286,26 @@ namespace OpenSim.Tests.Permissions | |||
286 | return clone; | 286 | return clone; |
287 | } | 287 | } |
288 | 288 | ||
289 | public void DeleteObjectsFolders() | ||
290 | { | ||
291 | // Delete everything in A2 and A3's Objects folders, so we can restart | ||
292 | for (int i = 1; i < 3; i++) | ||
293 | { | ||
294 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); | ||
295 | Assert.That(objsFolder, Is.Not.Null); | ||
296 | |||
297 | List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
298 | List<UUID> ids = new List<UUID>(); | ||
299 | foreach (InventoryItemBase it in items) | ||
300 | ids.Add(it.ID); | ||
301 | |||
302 | Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); | ||
303 | items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
304 | Assert.That(items.Count, Is.EqualTo(0), "A" + (i + 1)); | ||
305 | } | ||
306 | |||
307 | } | ||
308 | |||
289 | public string IdStr(InventoryItemBase item) | 309 | public string IdStr(InventoryItemBase item) |
290 | { | 310 | { |
291 | return item.Owner.ToString().Substring(34) + " : " + item.Name; | 311 | return item.Owner.ToString().Substring(34) + " : " + item.Name; |
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 3b711a1..c68bbdf 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs | |||
@@ -44,6 +44,7 @@ namespace OpenSim.Tests.Permissions | |||
44 | [SetUp] | 44 | [SetUp] |
45 | public void SetUp() | 45 | public void SetUp() |
46 | { | 46 | { |
47 | Common.TheInstance.DeleteObjectsFolders(); | ||
47 | } | 48 | } |
48 | 49 | ||
49 | /// <summary> | 50 | /// <summary> |
diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 6a6ba2f..7d8027f 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs | |||
@@ -46,21 +46,7 @@ namespace OpenSim.Tests.Permissions | |||
46 | [SetUp] | 46 | [SetUp] |
47 | public void SetUp() | 47 | public void SetUp() |
48 | { | 48 | { |
49 | // Delete everything in A2 and A3's Objects folders from previous tests | 49 | Common.TheInstance.DeleteObjectsFolders(); |
50 | for (int i = 1; i < 3; i++) | ||
51 | { | ||
52 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); | ||
53 | Assert.That(objsFolder, Is.Not.Null); | ||
54 | |||
55 | List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
56 | List<UUID> ids = new List<UUID>(); | ||
57 | foreach (InventoryItemBase it in items) | ||
58 | ids.Add(it.ID); | ||
59 | |||
60 | Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); | ||
61 | items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
62 | Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1)); | ||
63 | } | ||
64 | } | 50 | } |
65 | 51 | ||
66 | /// <summary> | 52 | /// <summary> |