30 using NUnit.Framework;
32 using OpenSim.Framework;
33 using OpenSim.Server.Base;
34 using OpenSim.Services.Interfaces;
35 using OpenSim.Tests.Common;
37 namespace OpenSim.Services.InventoryService.Tests
50 IConfigSource config =
new IniConfigSource();
51 config.AddConfig(
"InventoryService");
52 config.Configs[
"InventoryService"].Set(
"StorageProvider",
"OpenSim.Tests.Common.dll");
55 "OpenSim.Services.InventoryService.dll:XInventoryService",
new Object[] { config });
67 TestHelpers.InMethod();
69 string creatorId = TestHelpers.ParseTail(0x1).ToString();
70 UUID ownerId = TestHelpers.ParseTail(0x2);
71 UUID itemId = TestHelpers.ParseTail(0x10);
72 UUID assetId = TestHelpers.ParseTail(0x20);
73 UUID folderId = TestHelpers.ParseTail(0x30);
74 int invType = (int)InventoryType.Animation;
76 string itemName =
"item1";
83 CreatorIdentification = creatorId.ToString(),
91 Assert.That(xis.AddItem(itemToStore), Is.True);
94 itemRetrieved = xis.GetItem(itemRetrieved);
96 Assert.That(itemRetrieved, Is.Not.Null);
97 Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId));
98 Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId));
99 Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId));
100 Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId));
101 Assert.That(itemRetrieved.InvType, Is.EqualTo(invType));
102 Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType));
103 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName));
109 TestHelpers.InMethod();
112 string creatorId = TestHelpers.ParseTail(0x1).ToString();
113 UUID ownerId = TestHelpers.ParseTail(0x2);
114 UUID itemId = TestHelpers.ParseTail(0x10);
115 UUID assetId = TestHelpers.ParseTail(0x20);
116 UUID folderId = TestHelpers.ParseTail(0x30);
117 int invType = (int)InventoryType.Animation;
119 string itemName =
"item1";
120 string itemName2 =
"item2";
127 CreatorIdentification = creatorId.ToString(),
132 AssetType = assetType
135 Assert.That(xis.AddItem(itemToStore), Is.True);
138 itemToStore.Name = itemName2;
140 Assert.That(xis.UpdateItem(itemToStore), Is.True);
143 itemRetrieved = xis.GetItem(itemRetrieved);
145 Assert.That(itemRetrieved, Is.Not.Null);
146 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName2));
149 string creatorId2 = TestHelpers.ParseTail(0x7).ToString();
150 UUID ownerId2 = TestHelpers.ParseTail(0x8);
151 UUID folderId2 = TestHelpers.ParseTail(0x70);
152 int invType2 = (int)InventoryType.CallingCard;
153 int assetType2 = (
int)AssetType.CallingCard;
154 string itemName3 =
"item3";
156 itemToStore.CreatorIdentification = creatorId2.ToString();
157 itemToStore.Owner = ownerId2;
158 itemToStore.Folder = folderId2;
159 itemToStore.InvType = invType2;
160 itemToStore.AssetType = assetType2;
161 itemToStore.Name = itemName3;
163 Assert.That(xis.UpdateItem(itemToStore), Is.True);
165 itemRetrieved = xis.GetItem(itemRetrieved);
167 Assert.That(itemRetrieved, Is.Not.Null);
168 Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId));
169 Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId));
170 Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId));
171 Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId));
172 Assert.That(itemRetrieved.InvType, Is.EqualTo(invType));
173 Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType));
174 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName3));
Tests for the XInventoryService
void TestAddItem()
Tests add item operation.
Inventory Item - contains all the properties associated with an individual inventory piece...
Interactive OpenSim region server
OpenSim.Framework.Animation Animation