public void ReturnTrue_WhenFeedingValidRule()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("1-3 a: abcde")
                      .WithValidator(e => new SecondPuzzleValidation(e))
                      .Build();

            Assert.True(sut.Verify());
        }
        public void ReturnFalse_WhenNoPositionIsNotOcuppiedByRequiredLetter()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("2-9 c: cdccccccd")
                      .WithValidator(e => new SecondPuzzleValidation(e))
                      .Build();

            Assert.False(sut.Verify());
        }
        public void ReturnTrue_WhenSecondPositionIsOccupiedByRequiredLetter()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("2-9 c: cdccccccc")
                      .WithValidator(e => new SecondPuzzleValidation(e))
                      .Build();

            Assert.True(sut.Verify());
        }
        public void ReturnFalse_WhenPasswordHasNoRequiredLetters()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("1-3 b: cdefg")
                      .WithValidator(e => new SecondPuzzleValidation(e))
                      .Build();

            Assert.False(sut.Verify());
        }
Esempio n. 5
0
        public void ReturnTrue_WhenRequiredLetterIsNotRequired()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("0-0 a: bcdef")
                      .WithValidator(e => new FirstPuzzleValidation(e))
                      .Build();

            Assert.True(sut.Verify());
        }
Esempio n. 6
0
        public void ReturnFalse_WhenPasswordHasTooFewRequiredLetters()
        {
            var sut = new PasswordValidation.Builder()
                      .ForEntry("2-3 b: abcdef")
                      .WithValidator(e => new FirstPuzzleValidation(e))
                      .Build();

            Assert.False(sut.Verify());
        }