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() --- .../Framework/Scenes/Tests/UserInventoryTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index c6bd296..bacf7c1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs @@ -53,6 +53,25 @@ namespace OpenSim.Region.Framework.Tests public class UserInventoryTests { [Test] + public void TestGiveInventoryItem() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneSetupHelpers.SetupScene(); + UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); + UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene); + InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID); + + scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID); + + InventoryItemBase retrievedItem1 + = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, user2.PrincipalID, "Objects/item1"); + + Assert.That(retrievedItem1, Is.Not.Null); + } + + [Test] public void TestGiveInventoryFolder() { TestHelper.InMethod(); -- cgit v1.1