public void GetByName_UserName_GetNewUserRoles() { // Arrange var repo = new FakeRepository(); repo.Save(new User("Iron man", new List <string> { "Admin", "User", "Moderator" })); repo.Save(new User("James bond", new List <string> { "Agent", "User" })); // Act var user = repo.GetByName("Iron man"); // Assert Assert.AreEqual(3, user.GetAllRoles().Length); }
public void Save_AddNewUser_GetSavedUser() { // Arrange var repo = new FakeRepository(); repo.Save(new User("Iron man", new List <string> { "Admin", "User", "Moderator" })); repo.Save(new User("James bond", new List <string> { "Agent", "User" })); // Act repo.Save(new User("John Doe", new List <string> { "Admin", "User", "Moderator" })); // Assert var user = repo.GetByName("John Doe"); Assert.NotNull(user); }