public void AddEntityValidator()
 {
     var ocm = new OpenClassMapping<CleanAddress>();
     Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(0));
     ocm.AddEntityValidator(new AssertAnimalAttribute());
     Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(1));
     ocm.AddEntityValidator(new OtherValidatorAttribute());
     Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(2));
 }
Example #2
0
        public void AddEntityValidator()
        {
            var ocm = new OpenClassMapping <CleanAddress>();

            Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(0));
            ocm.AddEntityValidator(new AssertAnimalAttribute());
            Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(1));
            ocm.AddEntityValidator(new OtherValidatorAttribute());
            Assert.That(ocm.GetClassAttributes().Count(), Is.EqualTo(2));
        }
Example #3
0
 public void AddClassConstraint(Attribute ruleArgs)
 {
     classMap.AddEntityValidator(ruleArgs);
 }