protected static ViewModelStub CreateInvalidVM(ValidationResult validationResult) { var behavior = new ValidationResultAggregatorStub(); behavior.ReturnedValidationResults[ValidationResultScope.All] = validationResult; return(ViewModelStub .WithBehaviors(behavior) .Build()); }
public void Setup() { Next = new ValidationResultAggregatorStub(); Next.ReturnedValidationResults[ValidationResultScope.PropertiesOnly] = PropertyResult; Next.ReturnedValidationResults[ValidationResultScope.ViewModelValidationsOnly] = ViewModelResult; Next.ReturnedValidationResults[ValidationResultScope.Descendants] = DescendantResult; Behavior = new ValidationResultAggregatorCacheBehavior(); Counter = new NextAggregatorInvocationCounter(); Context = ViewModelStub .WithBehaviors(Behavior, Counter, Next) .BuildContext(); }