public void RevalidatePropertyValidationsSelfOnly_CallsRevalidationBehaviorOfProperty() { Revalidator.RevalidatePropertyValidations(VM, VM.Property, ValidationScope.Self); Assert.AreEqual(RevalidateProperty, ActionLog); Assert.AreEqual(VM.GetContext(), VM.PropertyBehavior.LastRevalidateContext); Assert.IsNotNull(VM.PropertyBehavior.LastRevalidateContext); }
public void RevalidatePropertyValidationsDescendants_CallsRevalidationAndDescendantsValidationBehavior() { var scope = ValidationScope.SelfAndAllDescendants; Revalidator.RevalidatePropertyValidations(VM, VM.Property, scope); Assert.AreEqual(RevalidateDescendants + RevalidateProperty, ActionLog); Assert.AreEqual(VM.GetContext(), VM.PropertyBehavior.LastDescendantsContext); Assert.AreEqual(scope, VM.PropertyBehavior.LastDescendantsScope); }
protected void SetFailedResult(ValidatorInvocation target, string errorDetails) { var stateBefore = GetState(); SetupFailingValidator(target, errorDetails); if (target.TargetProperty != null) { Revalidator.RevalidatePropertyValidations( target.TargetVM, target.TargetProperty, ValidationScope.Self ); } else { Revalidator.RevalidateViewModelValidations(target.TargetVM); } stateBefore.RestoreToState(); }