Пример #1
0
        public void AddInheritance_should_create_InheritanceValidator()
        {
            _validator.RuleFor(x => x.Vehicle).AddInheritance(inheritance => { });

            var rule      = (PropertyRule)_validator.First();
            var validator = (ChildValidatorAdaptor)rule.CurrentValidator;

            validator.ValidatorType.ShouldEqual(typeof(InheritanceValidator <IVehicle>));
        }
Пример #2
0
        private void AssertValidator <TValidator>()
        {
            var rule = (PropertyRule)validator.First();

            rule.CurrentValidator.ShouldBe <TValidator>();
        }