public void UserAuthHandler_Login_user_inactive_Invalid() { var repository = new FakeUserAuthRepository(); var logRepository = new FakeAccessLogRepository(); var handler = new UserAuthHandler(repository, logRepository); var result = handler.Login("newUser", "123456"); Assert.IsFalse(result.Success); }
public void UserAuthHandler_Login_Valid() { var repository = new FakeUserAuthRepository(); var logRepository = new FakeAccessLogRepository(); var handler = new UserAuthHandler(repository, logRepository); var result = handler.Login("admin", "123456"); Assert.IsTrue(result.Success); }
public void UserAuthHandler_Login_user_inactive_Invalid() { var repository = new FakeUserAuthRepository(); var logRepository = new FakeAccessLogRepository(); var handler = new UserAuthHandler(repository, logRepository); var command = new UserLoginCommand(); command.Username = "******"; command.Password = "******"; var result = handler.Login(command); Assert.IsFalse(result.Success); }
public void UserAuthHandler_Login_Valid() { var repository = new FakeUserAuthRepository(); var logRepository = new FakeAccessLogRepository(); var handler = new UserAuthHandler(repository, logRepository); var command = new UserLoginCommand(); command.Username = "******"; command.Password = "******"; var result = handler.Login(command); Assert.IsTrue(result.Success); }