aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/Tests')
-rw-r--r--OpenSim/Data/Tests/BasicUserTest.cs22
1 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs
index dc8ccc3..1537d67 100644
--- a/OpenSim/Data/Tests/BasicUserTest.cs
+++ b/OpenSim/Data/Tests/BasicUserTest.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Data.Tests
53 public UUID agent1; 53 public UUID agent1;
54 public UUID agent2; 54 public UUID agent2;
55 public UUID agent3; 55 public UUID agent3;
56 public UUID agent4;
56 57
57 public UUID region1; 58 public UUID region1;
58 59
@@ -83,6 +84,7 @@ namespace OpenSim.Data.Tests
83 agent1 = UUID.Random(); 84 agent1 = UUID.Random();
84 agent2 = UUID.Random(); 85 agent2 = UUID.Random();
85 agent3 = UUID.Random(); 86 agent3 = UUID.Random();
87 agent4 = UUID.Random();
86 webkey = UUID.Random(); 88 webkey = UUID.Random();
87 region1 = UUID.Random(); 89 region1 = UUID.Random();
88 fname0 = RandomName(random); 90 fname0 = RandomName(random);
@@ -121,10 +123,9 @@ namespace OpenSim.Data.Tests
121 [Test] 123 [Test]
122 public void T010_CreateUser() 124 public void T010_CreateUser()
123 { 125 {
124 UserProfileData u1 = NewUser(user1,fname1,lname1); 126 UserProfileData u1 = NewUser(user1,fname1,lname1);
125 UserProfileData u2 = NewUser(user2,fname2,lname2); 127 UserProfileData u2 = NewUser(user2,fname2,lname2);
126 UserProfileData u3 = NewUser(user3,fname3,lname3); 128 UserProfileData u3 = NewUser(user3,fname3,lname3);
127 Console.WriteLine("Users are {0} {1} {2}",user1,user2,user3);
128 db.AddNewUserProfile(u1); 129 db.AddNewUserProfile(u1);
129 db.AddNewUserProfile(u2); 130 db.AddNewUserProfile(u2);
130 db.AddNewUserProfile(u3); 131 db.AddNewUserProfile(u3);
@@ -210,6 +211,22 @@ namespace OpenSim.Data.Tests
210 } 211 }
211 212
212 [Test] 213 [Test]
214 public void T022_ExceptionalCases()
215 {
216 // This will follow User behavior, return Null, in the future
217 UserAgentData a0 = NewAgent(user4,zero);
218 UserAgentData a4 = NewAgent(zero,agent4);
219 db.AddNewUserAgent(a0);
220 db.AddNewUserAgent(a4);
221 UserAgentData a0a = db.GetAgentByUUID(user4);
222 UserAgentData a4a = db.GetAgentByUUID(zero);
223 Assert.That(zero,Is.EqualTo(a0a.SessionID));
224 Assert.That(user4,Is.EqualTo(a0a.ProfileID));
225 Assert.That(agent4,Is.EqualTo(a4a.SessionID));
226 Assert.That(zero,Is.EqualTo(a4a.ProfileID));
227 }
228
229 [Test]
213 public void T030_CreateFriendList() 230 public void T030_CreateFriendList()
214 { 231 {
215 Dictionary<UUID, uint> perms = new Dictionary<UUID,uint>(); 232 Dictionary<UUID, uint> perms = new Dictionary<UUID,uint>();
@@ -256,6 +273,7 @@ namespace OpenSim.Data.Tests
256 273
257 [Test] 274 [Test]
258 public void T032_UpdateFriendPerms() 275 public void T032_UpdateFriendPerms()
276 // user1 has 1 friend, user3, who has permission 2 in T030.
259 { 277 {
260 List<FriendListItem> fl1 = db.GetUserFriendList(user1); 278 List<FriendListItem> fl1 = db.GetUserFriendList(user1);
261 Assert.That(fl1[0].FriendPerms,Is.EqualTo(2)); 279 Assert.That(fl1[0].FriendPerms,Is.EqualTo(2));