Example #1
0
        public void IsValidLogin_ShouldReturnTrue_WhenExistAccount()
        {
            // arrange
            UserRepository_Stub stub = new UserRepository_Stub();
            stub.ShouldBeValid = true;

            UserService service = new UserService();
            service.UserRepository = stub;

            // act
            LoginModel model = new LoginModel() { Username = "******", Password = "******" };
            bool result = service.IsValidLogin(model);

            // assert
            Assert.AreEqual(true, result);
        }
Example #2
0
        public bool IsValidLogin(LoginModel model)
        {
            // some validation

            return UserRepository.IsExist(model.Username, model.Password);
        }