diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Tests')
-rw-r--r-- | OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index 34f5c97..68303b0 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs | |||
@@ -29,6 +29,7 @@ using NUnit.Framework; | |||
29 | using NUnit.Framework.SyntaxHelpers; | 29 | using NUnit.Framework.SyntaxHelpers; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Data; | 31 | using OpenSim.Data; |
32 | using OpenSim.Framework; | ||
32 | using OpenSim.Framework.Communications.Cache; | 33 | using OpenSim.Framework.Communications.Cache; |
33 | using OpenSim.Region.Communications.Local; | 34 | using OpenSim.Region.Communications.Local; |
34 | using OpenSim.Tests.Common.Mock; | 35 | using OpenSim.Tests.Common.Mock; |
@@ -69,6 +70,34 @@ namespace OpenSim.Framework.Communications.Tests | |||
69 | existingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); | 70 | existingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); |
70 | Assert.That(existingUserInfo, Is.Not.Null, "User info not found by name"); | 71 | Assert.That(existingUserInfo, Is.Not.Null, "User info not found by name"); |
71 | } | 72 | } |
73 | |||
74 | [Test] | ||
75 | public void TestUpdateProfile() | ||
76 | { | ||
77 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000292"); | ||
78 | string firstName = "Inspector"; | ||
79 | string originalLastName = "Morse"; | ||
80 | string newLastName = "Gadget"; | ||
81 | |||
82 | UserProfileData newProfile = new UserProfileData(); | ||
83 | newProfile.ID = userId; | ||
84 | newProfile.FirstName = firstName; | ||
85 | newProfile.SurName = newLastName; | ||
86 | |||
87 | TestCommunicationsManager commsManager = new TestCommunicationsManager(); | ||
88 | UserProfileCacheService userCacheService = commsManager.UserProfileCacheService; | ||
89 | |||
90 | // Check that we can't update info before it exists | ||
91 | Assert.That(userCacheService.UpdateProfile(newProfile), Is.False); | ||
92 | |||
93 | // Check that we can update a profile once it exists | ||
94 | LocalUserServices lus = (LocalUserServices)commsManager.UserService; | ||
95 | lus.AddUser(firstName, originalLastName, "pingu", "ted@excellentadventure.com", 1000, 1000, userId); | ||
96 | |||
97 | Assert.That(userCacheService.UpdateProfile(newProfile), Is.True); | ||
98 | UserProfileData retrievedProfile = userCacheService.GetUserDetails(userId).UserProfile; | ||
99 | Assert.That(retrievedProfile.SurName, Is.EqualTo(newLastName)); | ||
100 | } | ||
72 | 101 | ||
73 | [Test] | 102 | [Test] |
74 | public void TestFetchInventory() | 103 | public void TestFetchInventory() |