Example #1
0
        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);
        }
Example #2
0
 public ActionResult ValidatePassword(UserPasswordDTO userPasswordDTO)
 {
     userPasswordDTO.IsValid = _passwordBL.CheckValidity(userPasswordDTO.UserID, userPasswordDTO.Password);
     return(View("Index", userPasswordDTO));
 }