Exemple #1
0
        public void Should_PassValidation_When_AllRulesPass()
        {
            // Arrange
            var passwordSaltValidator = new PasswordSaltValidator();
            var passwordSalt          = new PasswordSalt()
            {
                Salt = "!Q2w#E4r"
            };

            // Act
            var result  = passwordSaltValidator.Validate(passwordSalt);
            var isValid = result.IsValid;

            // Assert
            isValid.Should().Be(true);
        }
Exemple #2
0
        public void Should_FailValidation_When_SaltIsNull()
        {
            // Arrange
            var passwordSaltValidator = new PasswordSaltValidator();
            var passwordSalt          = new PasswordSalt()
            {
                Salt = null
            };


            // Act
            var result  = passwordSaltValidator.Validate(passwordSalt);
            var isValid = result.IsValid;

            // Assert
            isValid.Should().Be(false);
        }