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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 private PropertyStub <string> CreateProperty()
 {
     return(PropertyStub.Of <string>());
 }