29 using System.Collections.Generic;
31 using System.Reflection;
34 using NUnit.Framework;
36 using OpenSim.Framework;
37 using OpenSim.Services.Interfaces;
38 using OpenSim.Services.Connectors;
40 namespace Robust.Tests
50 string first =
"Completely";
51 string last =
"Clueless";
52 string email =
"foo@bar.com";
54 UserAccount account = m_Connector.CreateUser(first, last,
"123", email, UUID.Zero);
55 Assert.IsNotNull(account,
"Failed to create account " + first +
" " + last);
56 UUID user1 = account.PrincipalID;
58 account = m_Connector.GetUserAccount(UUID.Zero, user1);
59 Assert.NotNull(account,
"Failed to retrieve account for user id " + user1);
60 Assert.AreEqual(account.FirstName, first,
"First name does not match");
61 Assert.AreEqual(account.LastName, last,
"Last name does not match");
63 account = m_Connector.GetUserAccount(UUID.Zero, first, last);
64 Assert.IsNotNull(account,
"Failed to retrieve account for user " + first +
" " + last);
65 Assert.AreEqual(account.FirstName, first,
"First name does not match (bis)");
66 Assert.AreEqual(account.LastName, last,
"Last name does not match (bis)");
68 account.Email =
"user@example.com";
69 bool success = m_Connector.StoreUserAccount(account);
70 Assert.IsTrue(success,
"Failed to store existing account");
72 account = m_Connector.GetUserAccount(UUID.Zero, user1);
73 Assert.NotNull(account,
"Failed to retrieve account for user id " + user1);
74 Assert.AreEqual(account.Email,
"user@example.com",
"Incorrect email");
76 account =
new UserAccount(UUID.Zero,
"DoesNot",
"Exist",
"xxx@xxx.com");
77 success = m_Connector.StoreUserAccount(account);
78 Assert.IsFalse(success,
"Storing a non-existing account must fail");
80 account = m_Connector.GetUserAccount(UUID.Zero,
"DoesNot",
"Exist");
81 Assert.IsNull(account,
"Account DoesNot Exist must not be there");