aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs8
-rw-r--r--OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs15
2 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
index 10c275e..abca792 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
@@ -97,6 +97,14 @@ namespace OpenSim.Region.Framework.Tests
97 = UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID, "folder1"); 97 = UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID, "folder1");
98 98
99 Assert.That(retrievedFolder1, Is.Not.Null); 99 Assert.That(retrievedFolder1, Is.Not.Null);
100
101 // Try giving back the freshly received folder
102 scene.GiveInventoryFolder(user1.PrincipalID, user2.PrincipalID, retrievedFolder1.ID, UUID.Zero);
103
104 List<InventoryFolderBase> reretrievedFolders
105 = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, "folder1");
106
107 Assert.That(reretrievedFolders.Count, Is.EqualTo(2));
100 } 108 }
101 } 109 }
102} \ No newline at end of file 110} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
index 875bf4a..1703597 100644
--- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
@@ -147,8 +147,7 @@ namespace OpenSim.Tests.Common
147 /// <returns>null if no folder matching the path was found</returns> 147 /// <returns>null if no folder matching the path was found</returns>
148 public static InventoryFolderBase GetInventoryFolder(IInventoryService inventoryService, UUID userId, string path) 148 public static InventoryFolderBase GetInventoryFolder(IInventoryService inventoryService, UUID userId, string path)
149 { 149 {
150 List<InventoryFolderBase> folders 150 List<InventoryFolderBase> folders = GetInventoryFolders(inventoryService, userId, path);
151 = InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path);
152 151
153 if (folders.Count != 0) 152 if (folders.Count != 0)
154 return folders[0]; 153 return folders[0];
@@ -157,6 +156,18 @@ namespace OpenSim.Tests.Common
157 } 156 }
158 157
159 /// <summary> 158 /// <summary>
159 /// Get the inventory folders that match the path name.
160 /// </summary>
161 /// <param name="inventoryService"></param>
162 /// <param name="userId"></param>
163 /// <param name="path"></param>
164 /// <returns>An empty list if no matching folders were found</returns>
165 public static List<InventoryFolderBase> GetInventoryFolders(IInventoryService inventoryService, UUID userId, string path)
166 {
167 return InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path);
168 }
169
170 /// <summary>
160 /// Get the inventory item that matches the path name. If there are multiple items then only the first 171 /// Get the inventory item that matches the path name. If there are multiple items then only the first
161 /// is returned. 172 /// is returned.
162 /// </summary> 173 /// </summary>