public void GetUsersWithData() { IUsersStorageProviderV40 prov = GetProvider(); UserInfo user1 = prov.AddUser("user1", "User1", "password", "*****@*****.**", true, DateTime.UtcNow); UserInfo user2 = prov.AddUser("user2", "User2", "password", "*****@*****.**", true, DateTime.UtcNow); UserInfo user3 = prov.AddUser("user3", "User3", "password", "*****@*****.**", true, DateTime.UtcNow); UserInfo user4 = prov.AddUser("user4", "User4", "password", "*****@*****.**", true, DateTime.UtcNow); Assert.AreEqual(0, prov.GetUsersWithData("Key").Count, "Wrong user count"); prov.StoreUserData(user1, "Key", "Value"); prov.StoreUserData(user2, "Key2", "Value"); prov.StoreUserData(user4, "Key", "Value2"); IDictionary <UserInfo, string> data = prov.GetUsersWithData("Key"); Assert.AreEqual(2, data.Count, "Wrong user count"); UserInfo[] users = new UserInfo[data.Count]; data.Keys.CopyTo(users, 0); AssertUserInfosAreEqual(user1, users[0], true); AssertUserInfosAreEqual(user4, users[1], true); Assert.AreEqual("Value", data[users[0]], "Wrong data"); Assert.AreEqual("Value2", data[users[1]], "Wrong data"); }
public void GetUsersWithData_InvalidKey(string k) { IUsersStorageProviderV40 prov = GetProvider(); prov.GetUsersWithData(k); }