Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public VMCollectionStubBuilder()
 {
     _ownerVM       = ViewModelStub.Build();
     _ownerProperty = PropertyStub.Build();
     _items         = Enumerable.Empty <T>();
 }
Exemplo n.º 5
0
 private VMCollection <IViewModel> CreateCollection()
 {
     return(new VMCollection <IViewModel>(ViewModelStub.Build(), PropertyStub.Build()));
 }