public void ByDefaultValidateDataAnnotationOnSetValue() { // By default instance property set to check annotation validation var model = new ModelWithoutAnnotation(); using (model.SuspendValidations()) { model.Counter = 1; Assert.AreEqual(true, model.HasNotValidatedProperties()); } }
public void OnInstancePropertyIgnoreDataAnnotationSkipAnnotationValidation() { // Set intance property to skip data annotations validation var model = new ModelWithoutAnnotation(); using (model.SuspendValidations()) { model.SetValidateUsingDataAnnotations(false); model.Counter = 1; Assert.AreEqual(false, model.HasNotValidatedProperties()); } }