aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Tests')
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs47
1 files changed, 37 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 41c8e3c..807afcc 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -142,17 +142,44 @@ namespace OpenSim.Framework.Communications.Tests
142 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); 142 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
143 143
144 // 1: Test updates that don't involve moving the folder 144 // 1: Test updates that don't involve moving the folder
145 string newFolderName1 = "newFolderName1"; 145 {
146 ushort folderType1 = (ushort)AssetType.Texture; 146 string newFolderName1 = "newFolderName1";
147 userInfo.UpdateFolder(newFolderName1, folder1Id, folderType1, rootFolder.ID); 147 ushort folderType1 = (ushort)AssetType.Texture;
148 148 userInfo.UpdateFolder(newFolderName1, folder1Id, folderType1, rootFolder.ID);
149 InventoryFolderImpl folder1 = rootFolder.GetChildFolder(folder1Id); 149
150 Assert.That(newFolderName1, Is.EqualTo(folder1.Name)); 150 InventoryFolderImpl folder1 = rootFolder.GetChildFolder(folder1Id);
151 Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type)); 151 Assert.That(newFolderName1, Is.EqualTo(folder1.Name));
152 Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type));
153
154 InventoryFolderBase dataFolder1 = inventoryDataPlugin.getInventoryFolder(folder1Id);
155 Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name));
156 Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type));
157 }
158
159 // 2: Test an update that also involves moving the folder
160 {
161 UUID folder2Id = UUID.Parse("00000000-0000-0000-0000-000000000061");
162 userInfo.CreateFolder("folder2", folder2Id, (ushort)AssetType.Animation, rootFolder.ID);
163 InventoryFolderImpl folder2 = rootFolder.GetChildFolder(folder2Id);
164
165 string newFolderName2 = "newFolderName2";
166 ushort folderType2 = (ushort)AssetType.Bodypart;
167 userInfo.UpdateFolder(newFolderName2, folder1Id, folderType2, folder2Id);
168
169 InventoryFolderImpl folder1 = folder2.GetChildFolder(folder1Id);
170 Assert.That(newFolderName2, Is.EqualTo(folder1.Name));
171 Assert.That(folderType2, Is.EqualTo((ushort)folder1.Type));
172 Assert.That(folder2Id, Is.EqualTo(folder1.ParentID));
173
174 Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True);
175 Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False);
176
177 InventoryFolderBase dataFolder1 = inventoryDataPlugin.getInventoryFolder(folder1Id);
178 Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name));
179 Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type));
180 Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID));
181 }
152 182
153 InventoryFolderBase dataFolder1 = inventoryDataPlugin.getInventoryFolder(folder1Id);
154 Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name));
155 Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type));
156 } 183 }
157 184
158 /// <summary> 185 /// <summary>