public void Shared_When_respects_the_smaller_scope_of_a_inner_Unless_when_the_inner_Unless_predicate_fails()
        {
            var validator = new SharedConditionWithScopedUnlessValidator();
            var person    = new Person()
            {
                Id = 4                                         // triggers the shared When predicate
            };

            person.Orders.Add(new Order());             // fails the inner Unless predicate

            var result = validator.Validate(person);

            result.Errors.Count.ShouldEqual(1);
        }
        public void Outer_Unless_clause_will_trump_an_inner_Unless_clause_when_inner_fails_but_the_outer_is_satisfied()
        {
            var validator = new SharedConditionWithScopedUnlessValidator();
            var person    = new Person()
            {
                Id  = 4,                                        // triggers the shared When predicate
                Age = 70                                        // satisfies the outer Unless predicate
            };

            person.Orders.Add(new Order());             // fails the inner Unless predicate

            var result = validator.Validate(person);

            result.Errors.Count.ShouldEqual(0);
        }
        public void Shared_When_respects_the_smaller_scope_of_an_inner_Unless_when_the_inner_Unless_predicate_is_satisfied()
        {
            var validator = new SharedConditionWithScopedUnlessValidator();
            var person    = new Person()
            {
                Id = 4                                         // triggers the shared When predicate
            };

            person.CreditCard = "1234123412341234";             // satisfies the inner Unless predicate
            person.Orders.Add(new Order());

            var result = validator.Validate(person);

            result.Errors.Count.ShouldEqual(0);
        }