示例#1
0
        public void WhenCustomerHasAgeLessThan18_ThenValidationFails()
        {
            var validator = new CustomerValidator();
            var customer  = new CustomerMock(16);

            bool validate = validator.Validate(customer);

            validate.Should().BeFalse();
        }
示例#2
0
        public void WhenCustomerHasAgeGreaterThanOrEquealTo18_ThenValidationTrue(
            [Values(18, 19)] int expectedAge)
        {
            var validator = new CustomerValidator();
            var customer  = new CustomerMock(expectedAge: expectedAge);

            bool validate = validator.Validate(customer);

            validate.Should().BeTrue();
        }