コード例 #1
0
        public void Create_a_passport_field_for_passport_field_description(
            string passportFieldDescription,
            Type expectedPassportFieldType)
        {
            //When
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //Then
            Assert.IsType(expectedPassportFieldType, passportField);
        }
コード例 #2
0
        public void Be_always_valid(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }
コード例 #3
0
        public void Be_valid_when_composed_of_nine_digit_number_including_leading_zeroes(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }
コード例 #4
0
        public void Be_invalid_for(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.False(passportFieldValidity);
        }
コード例 #5
0
        public void Be_valid_when_start_with_sharp_followed_by_exactly_six_characters_0_9_or_a_f(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }
コード例 #6
0
        public void Be_valid_when_know_eye_color(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }
コード例 #7
0
        public void Be_valid_when_number_at_least_59_and_at_most_76_and_followed_by_in(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }
コード例 #8
0
        public void Be_valid_when_composed_of_four_digits_at_least_1920_and_at_most_2002(string passportFieldDescription)
        {
            //Given
            var passportField = PassportFieldFactory.Create(passportFieldDescription);

            //When
            var passportFieldValidity = passportField.IsValid();

            //Then
            Assert.True(passportFieldValidity);
        }