예제 #1
0
        public void CanChangeLoginName()
        {
            // Arrange
            User user = new User() { LoginName = "Bob" };

            FakeRepository repository = new FakeRepository();
            repository.Add(user);

            AdminController target = new AdminController(repository);

            string oldLogin = user.LoginName;
            string newLogin = "******";

            // Action
            target.ChangeLoginName(oldLogin, newLogin);

            // Assert
            Assert.AreEqual(newLogin, user.LoginName);
            Assert.IsTrue(repository.DidSubmitChanges);
        }
예제 #2
0
 public void Add(User user)
 {
     this.Users.Add(user);
 }