From 46d06b6c4c858779472220db88dc64bae4489c38 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Aug 2010 17:10:52 +0100 Subject: add test to check move of task item to user inventory when a target folder is explicitly given --- .../Framework/Scenes/Tests/TaskInventoryTests.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index ed2f324..da8199d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -95,6 +95,32 @@ namespace OpenSim.Region.Framework.Tests /// /// This should place it in the most suitable user folder. [Test] + public void TestMoveTaskInventoryItem() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + UserAccount user1 = CreateUser(scene); + SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); + SceneObjectPart sop1 = sog1.RootPart; + TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); + InventoryFolderBase folder + = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; + + // Perform test + scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID); + + InventoryItemBase ncUserItem + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); + Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found"); + } + + /// + /// Test MoveTaskInventoryItem where the item has no parent folder assigned. + /// + /// This should place it in the most suitable user folder. + [Test] public void TestMoveTaskInventoryItemNoParent() { TestHelper.InMethod(); -- cgit v1.1