* add purge folder test

0.6.1-post-fixes
Justin Clarke Casey 2008-12-12 19:37:51 +00:00
parent 7bbab12158
commit 9f6e567cb1
1 changed files with 25 additions and 2 deletions

View File

@ -138,7 +138,6 @@ namespace OpenSim.Framework.Communications.Tests
UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000020"); UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000020");
UUID folder2Id = UUID.Parse("00000000-0000-0000-0000-000000000021"); UUID folder2Id = UUID.Parse("00000000-0000-0000-0000-000000000021");
UUID folderToMoveId = UUID.Parse("00000000-0000-0000-0000-000000000030"); UUID folderToMoveId = UUID.Parse("00000000-0000-0000-0000-000000000030");
InventoryFolderImpl rootFolder = userInfo.RootFolder; InventoryFolderImpl rootFolder = userInfo.RootFolder;
userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
@ -158,5 +157,29 @@ namespace OpenSim.Framework.Communications.Tests
Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False); Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False);
} }
/// <summary>
/// Test purging an inventory folder
/// </summary>
public void TestPurgeFolder()
{
IUserDataPlugin userDataPlugin = new TestUserDataPlugin();
IInventoryDataPlugin inventoryDataPlugin = new TestInventoryDataPlugin();
CommunicationsManager commsManager
= UserProfileTestUtils.SetupServices(userDataPlugin, inventoryDataPlugin);
CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000070");
InventoryFolderImpl rootFolder = userInfo.RootFolder;
userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
// Test purge
userInfo.PurgeFolder(rootFolder.ID);
Assert.That(rootFolder.RequestListOfFolders(), Is.Empty);
Assert.That(inventoryDataPlugin.getInventoryFolder(folder1Id), Is.Null);
}
} }
} }