示例#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.");
        }
示例#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.");
        }
示例#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.");
        }