aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Tests
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-12 20:43:42 +0000
committerJustin Clarke Casey2008-12-12 20:43:42 +0000
commitb1f018aa2600281cc379128f17c3c141b478f39d (patch)
treeb7830bc43f57acd44e98b02c57d2ac2cc368bd18 /OpenSim/Framework/Communications/Tests
parent* Actually add the new user profile cache tests to the bamboo ci build (diff)
downloadopensim-SC_OLD-b1f018aa2600281cc379128f17c3c141b478f39d.zip
opensim-SC_OLD-b1f018aa2600281cc379128f17c3c141b478f39d.tar.gz
opensim-SC_OLD-b1f018aa2600281cc379128f17c3c141b478f39d.tar.bz2
opensim-SC_OLD-b1f018aa2600281cc379128f17c3c141b478f39d.tar.xz
* Create update folder test
* Correct small logic elidation
Diffstat (limited to 'OpenSim/Framework/Communications/Tests')
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 0914bfb..41c8e3c 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -122,6 +122,38 @@ namespace OpenSim.Framework.Communications.Tests
122 Assert.That(inventoryDataPlugin.getInventoryFolder(folderId), Is.Not.Null); 122 Assert.That(inventoryDataPlugin.getInventoryFolder(folderId), Is.Not.Null);
123 Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True); 123 Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True);
124 } 124 }
125
126 /// <summary>
127 /// Test updating a folder
128 /// </summary>
129 [Test]
130 public void TestUpdateFolder()
131 {
132 IUserDataPlugin userDataPlugin = new TestUserDataPlugin();
133 IInventoryDataPlugin inventoryDataPlugin = new TestInventoryDataPlugin();
134
135 CommunicationsManager commsManager
136 = UserProfileTestUtils.SetupServices(userDataPlugin, inventoryDataPlugin);
137 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
138
139 UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
140 InventoryFolderImpl rootFolder = userInfo.RootFolder;
141
142 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
143
144 // 1: Test updates that don't involve moving the folder
145 string newFolderName1 = "newFolderName1";
146 ushort folderType1 = (ushort)AssetType.Texture;
147 userInfo.UpdateFolder(newFolderName1, folder1Id, folderType1, rootFolder.ID);
148
149 InventoryFolderImpl folder1 = rootFolder.GetChildFolder(folder1Id);
150 Assert.That(newFolderName1, Is.EqualTo(folder1.Name));
151 Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type));
152
153 InventoryFolderBase dataFolder1 = inventoryDataPlugin.getInventoryFolder(folder1Id);
154 Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name));
155 Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type));
156 }
125 157
126 /// <summary> 158 /// <summary>
127 /// Test moving an inventory folder 159 /// Test moving an inventory folder