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)); }
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)); }
public void AddClassConstraint(Attribute ruleArgs) { classMap.AddEntityValidator(ruleArgs); }