public void HandleChange_DescendantPropertyChanged_PerformsViewModelValidation() { var args = ChangeArgs.PropertyChanged(PropertyStub.Of <string>(), null) .PrependViewModel(VM) .PrependViewModel(new ViewModelStub()); Behavior.HandleChange(Context, args); Assert.AreEqual(HandleChangeNext + Validate + RevalidateNext, ActionLog); }
public void PropertyChange_DoesNotInvalidateCache() { Behavior.GetValidationResult(Context, ValidationResultScope.All); Counter.Invocations = 0; Behavior.HandleChange( Context, ChangeArgs.PropertyChanged(PropertyStub.Of <string>(), ValueStage.ValidatedValue).PrependViewModel(ViewModelStub.Build()) ); var actualResult = Behavior.GetValidationResult(Context, ValidationResultScope.All); var expectedResult = ValidationResult.Join(new[] { PropertyResult, ViewModelResult, DescendantResult }); Assert.AreEqual(0, Counter.Invocations); Assert.AreEqual(expectedResult, actualResult); }
private PropertyStub <string> CreateProperty() { return(PropertyStub.Of <string>()); }