Пример #1
0
        public void NotifyChange_WithValidationResultChangeForOwnProperty_CallsValidationResultChanged()
        {
            var property = PropertyStub.Build();

            VMInterface.NotifyChange(ChangeArgs
                                     .ValidationResultChanged(property, ValueStage.Value)
                                     .PrependViewModel(VM)
                                     );

            Assert.AreEqual(property, VM.LastOnValidationStateChangedInvocation);
        }
Пример #2
0
        public void NotifyChange_WithValidationResultChangeForDescendantProperty_DoesNothing()
        {
            VMInterface.NotifyChange(ChangeArgs
                                     .ValidationResultChanged(PropertyStub.Build(), ValueStage.Value)
                                     .PrependViewModel(ViewModelStub.Build())
                                     .PrependViewModel(VM)
                                     );

            Assert.IsNull(VM.LastOnPropertyChangedInvocation);
            Assert.IsNull(VM.LastOnValidationStateChangedInvocation);
        }
Пример #3
0
        public void NotifyChange_WithPropertyChangeForOwnProperty_CallsOnPropertyChanged()
        {
            var property = PropertyStub.Build();

            VMInterface.NotifyChange(ChangeArgs
                                     .PropertyChanged(property, ValueStage.DisplayValue)
                                     .PrependViewModel(VM)
                                     );

            Assert.AreEqual(property, VM.LastOnPropertyChangedInvocation);
        }
Пример #4
0
 public VMCollectionStubBuilder()
 {
     _ownerVM       = ViewModelStub.Build();
     _ownerProperty = PropertyStub.Build();
     _items         = Enumerable.Empty <T>();
 }
Пример #5
0
 private VMCollection <IViewModel> CreateCollection()
 {
     return(new VMCollection <IViewModel>(ViewModelStub.Build(), PropertyStub.Build()));
 }