Exemple #1
0
        public void Verify_GivenPasswordDoesNotContainAtleast1UpperCase_ShouldThrowException()
        {
            //arrange
            var sut = new PasswordVerifier();
            //act
            var exception = Assert.Throws <System.Exception>(() => sut.Verify("abcde1234"));

            //assert
            exception.Message.Should().Be("Rule Violation. password should have one uppercase letter at least.");
        }
Exemple #2
0
        public void Verify_GivenPasswordIsLessThan8Characters_ShouldThrowException()
        {
            //arrange
            var sut = new PasswordVerifier();
            //act
            var exception = Assert.Throws <System.Exception>(() => sut.Verify("test"));

            //assert
            exception.Message.Should().Be("Length Rule Violation. Password should be of more than characters length.");
        }
Exemple #3
0
        public void Verify_GivenPasswordNull_ShouldThrowException()
        {
            //arrange
            var sut = new PasswordVerifier();
            //act
            var exception = Assert.Throws <System.Exception>(() => sut.Verify(null));

            //assert
            exception.Message.Should().Be("Length Rule Violation. Password should not be null.");
        }