示例#1
0
        public void HandleChange_WithValidationResultChangedOfOwnViewModel_UpdatesCachedResults()
        {
            var vm = new TestVM();

            var expected = new ExpectedResults {
                ViewModel = CreateValidationResult("View model error")
            };

            vm.ViewModelResultSetup = expected.ViewModel;
            vm.CallHandleChangeForViewModel();

            AssertBehaviorResults(vm, expected);
        }
示例#2
0
        public void HandleChange_WithValidationResultChangedOfOwnViewModel_UpdatesBehaviorOfParentViewModel()
        {
            var child  = new TestVM();
            var parent = new TestVM();

            parent.MakePropertiesAndViewModelInvalid();
            child.ViewModelResultSetup = CreateValidationResult("View model error");

            child.Kernel.Parents.Add(parent);
            child.CallHandleChangeForViewModel();

            var expectedParentResult = parent.GetCurrentlySetupResults();

            expectedParentResult.Descenants = child.ValidationResult;

            AssertBehaviorResults(parent, expectedParentResult);
        }