public void CheckValidity_GoodInputData_ReturnsValidPassword() { // Arrange DateTime date = DateTime.Now; UserPassword userPassword = new UserPassword { UserID = 1, Password = "******", ValideFrom = date, ValideTo = date.AddSeconds(30) }; _repoMock.Setup(x => x.GetUserPassword(userPassword.Id, userPassword.Password)).Returns(userPassword); // Act string validity = _passwordBL.CheckValidity(userPassword.Id, userPassword.Password); // Assert Assert.Equal("Password Is valid", validity); }
public ActionResult ValidatePassword(UserPasswordDTO userPasswordDTO) { userPasswordDTO.IsValid = _passwordBL.CheckValidity(userPasswordDTO.UserID, userPasswordDTO.Password); return(View("Index", userPasswordDTO)); }