public void PreventsAttributeBasedValidation() { var model = new SuspendValidationModel(); Assert.IsFalse(model.HasErrors); model.SuspendValidationWrapper = true; model.FirstName = null; Assert.IsFalse(model.HasErrors); }
public void PreventsAttributeBasedValidation() { var model = new SuspendValidationModel(); var validation = model as IValidatable; Assert.IsFalse(validation.HasErrors); using (model.SuspendValidations()) { model.FirstName = null; Assert.IsFalse(validation.HasErrors); } }
public void CorrectlyValidatesUnvalidatedPropertiesWhenSetToTrue() { var model = new SuspendValidationModel(); Assert.IsFalse(model.HasErrors); model.SuspendValidationWrapper = true; model.FirstName = null; Assert.IsFalse(model.HasErrors); model.SuspendValidationWrapper = false; Assert.IsTrue(model.HasErrors); }
public void CorrectlyValidatesUnvalidatedPropertiesWhenSetToTrue() { var model = new SuspendValidationModel(); var validation = model; Assert.IsFalse(validation.HasErrors); using (model.SuspendValidations()) { model.FirstName = null; Assert.IsFalse(validation.HasErrors); } Assert.IsTrue(validation.HasErrors); }