public void NotifyChange_WithValidationResultChangeForOwnProperty_CallsValidationResultChanged() { var property = PropertyStub.Build(); VMInterface.NotifyChange(ChangeArgs .ValidationResultChanged(property, ValueStage.Value) .PrependViewModel(VM) ); Assert.AreEqual(property, VM.LastOnValidationStateChangedInvocation); }
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); }
public void NotifyChange_WithPropertyChangeForOwnProperty_CallsOnPropertyChanged() { var property = PropertyStub.Build(); VMInterface.NotifyChange(ChangeArgs .PropertyChanged(property, ValueStage.DisplayValue) .PrependViewModel(VM) ); Assert.AreEqual(property, VM.LastOnPropertyChangedInvocation); }
public VMCollectionStubBuilder() { _ownerVM = ViewModelStub.Build(); _ownerProperty = PropertyStub.Build(); _items = Enumerable.Empty <T>(); }
private VMCollection <IViewModel> CreateCollection() { return(new VMCollection <IViewModel>(ViewModelStub.Build(), PropertyStub.Build())); }