From 1543fd7fff3b3f3a7ce07caa3ed19846b6587df7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 4 Jun 2011 00:20:54 +0100
Subject: extend TestGiveInventoryFolder() to check for the receipt by user 2
---
.../Tests/Common/Helpers/UserInventoryHelpers.cs | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
(limited to 'OpenSim/Tests')
diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
index e33145f..03215f2 100644
--- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
@@ -26,8 +26,10 @@
*/
using System;
+using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
+using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
@@ -118,5 +120,24 @@ namespace OpenSim.Tests.Common
else
return newFolder;
}
+
+ ///
+ /// Get the inventory folder that matches the path name. If there are multiple folders then only the first
+ /// is returned.
+ ///
+ ///
+ ///
+ ///
+ /// null if no folder matching the path was found
+ public static InventoryFolderBase GetInventoryFolder(IInventoryService inventoryService, UUID userId, string path)
+ {
+ List folders
+ = InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path);
+
+ if (folders.Count != 0)
+ return folders[0];
+ else
+ return null;
+ }
}
}
\ No newline at end of file
--
cgit v1.1