29 using System.Collections.Generic;
30 using System.Reflection;
32 using System.Threading;
36 using NUnit.Framework;
38 using OpenMetaverse.Assets;
39 using OpenSim.Framework;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Region.Framework.Interfaces;
42 using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
43 using OpenSim.Region.CoreModules.World.Serialiser;
44 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
45 using OpenSim.Services.Interfaces;
46 using OpenSim.Tests.Common;
48 namespace OpenSim.
Region.Framework.Tests
56 TestHelpers.InMethod();
60 string foldersName =
"f1";
63 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
65 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName,
false);
67 List<InventoryFolderBase> oneFolder
68 = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName);
70 Assert.That(oneFolder.Count, Is.EqualTo(1));
72 Assert.That(firstRetrievedFolder.Name, Is.EqualTo(foldersName));
74 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName,
false);
76 List<InventoryFolderBase> twoFolders
77 = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName);
79 Assert.That(twoFolders.Count, Is.EqualTo(2));
80 Assert.That(twoFolders[0].Name, Is.EqualTo(foldersName));
81 Assert.That(twoFolders[1].Name, Is.EqualTo(foldersName));
82 Assert.That(twoFolders[0].ID, Is.Not.EqualTo(twoFolders[1].ID));
88 TestHelpers.InMethod();
92 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
93 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
94 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene,
"item1", user1.PrincipalID);
98 scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID, out message);
101 = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, user2.PrincipalID,
"Notecards/item1");
103 Assert.That(retrievedItem1, Is.Not.Null);
106 scene.GiveInventoryItem(user1.PrincipalID, user2.PrincipalID, retrievedItem1.ID, out message);
108 List<InventoryItemBase> reretrievedItems
109 = UserInventoryHelpers.GetInventoryItems(scene.InventoryService, user1.PrincipalID,
"Notecards/item1");
111 Assert.That(reretrievedItems.Count, Is.EqualTo(2));
117 TestHelpers.InMethod();
121 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
122 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
124 = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID,
"folder1",
false);
126 scene.GiveInventoryFolder(null, user2.PrincipalID, user1.PrincipalID, folder1.ID, UUID.Zero);
129 = UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID,
"folder1");
131 Assert.That(retrievedFolder1, Is.Not.Null);
134 scene.GiveInventoryFolder(null, user1.PrincipalID, user2.PrincipalID, retrievedFolder1.ID, UUID.Zero);
136 List<InventoryFolderBase> reretrievedFolders
137 = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID,
"folder1");
139 Assert.That(reretrievedFolders.Count, Is.EqualTo(2));
void TestCreateInventoryFolders()
void TestGiveInventoryFolder()
System.Timers.Timer Timer
Inventory Item - contains all the properties associated with an individual inventory piece...
Helpers for setting up scenes.
System.Timers.Timer Timer
void TestGiveInventoryItem()