From 30213e141bf41e1240d5bceb42a154dacc05e643 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 11 Dec 2008 19:57:12 +0000
Subject: * Add create folder userinfo test
---
.../Communications/Cache/InventoryFolderImpl.cs | 2 +-
.../Tests/Cache/UserProfileCacheServiceTests.cs | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index 83ac239..ad55c44 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Framework.Communications.Cache
}
///
- /// Create a new subfolder. This exists only in the cache.
+ /// Create a new subfolder.
///
///
///
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 054c746..d73d3d5 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -89,8 +89,28 @@ namespace OpenSim.Framework.Communications.Tests
/// Test moving an inventory folder
///
[Test]
- public void TestMoveFolder()
+ public void TestCreateFolder()
{
+ UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000004");
+
+ CommunicationsManager commsManager = new TestCommunicationsManager();
+ LocalUserServices lus = (LocalUserServices)commsManager.UserService;
+ lus.AddPlugin(new TestUserDataPlugin());
+ TestInventoryDataPlugin inventoryDataPlugin = new TestInventoryDataPlugin();
+ ((LocalInventoryService)commsManager.InventoryService).AddPlugin(inventoryDataPlugin);
+
+ lus.AddUser("Bill", "Bailey", "troll", "bill@bailey.com", 1000, 1000, userId);
+
+ commsManager.UserProfileCacheService.RequestInventoryForUser(userId);
+
+ CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
+
+ UUID folderId = UUID.Parse("00000000-0000-0000-0000-000000000010");
+ Assert.That(userInfo.RootFolder.SubFolders.ContainsKey(folderId), Is.False);
+
+ userInfo.CreateFolder("testFolder", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID);
+ Assert.That(inventoryDataPlugin.getInventoryFolder(folderId), Is.Not.Null);
+ Assert.That(userInfo.RootFolder.SubFolders.ContainsKey(folderId), Is.True);
}
}
}
--
cgit v1.1