From 896f039513398a46458b18ef49f52a9a3ac43659 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Jun 2011 00:51:49 +0100 Subject: create TestGetInventoryItem() --- .../Tests/Common/Helpers/UserInventoryHelpers.cs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index 03215f2..93b655a 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -43,7 +43,20 @@ namespace OpenSim.Tests.Common public static readonly string PATH_DELIMITER = "/"; /// - /// Creates a notecard in the objects folder. + /// Creates a notecard in the objects folder and specify an item id. + /// + /// + /// + /// + /// + /// + public static InventoryItemBase CreateInventoryItem(Scene scene, string itemName, UUID userId) + { + return CreateInventoryItem(scene, itemName, UUID.Random(), userId); + } + + /// + /// Creates a notecard in the objects folder and specify an item id. /// /// /// @@ -139,5 +152,18 @@ namespace OpenSim.Tests.Common else return null; } + + /// + /// Get the inventory item that matches the path name. If there are multiple items then only the first + /// is returned. + /// + /// + /// + /// + /// null if no item matching the path was found + public static InventoryItemBase GetInventoryItem(IInventoryService inventoryService, UUID userId, string path) + { + return InventoryArchiveUtils.FindItemByPath(inventoryService, userId, path); + } } } \ No newline at end of file -- cgit v1.1