public void TestSimpleToObservable() { TestObjectNotifyPropertyChanged obj = new TestObjectNotifyPropertyChanged() { Number = 2 }; var number = obj.ToObservable(o => o.Number); var numberObserver = Substitute.For <IObserver <int> >(); using (number.Subscribe(numberObserver)) { numberObserver.Received(1).OnNext(2); obj.Number = 3; numberObserver.Received(1).OnNext(3); } numberObserver.ReceivedWithAnyArgs(2).OnNext(default);
public ObservableObjectWatchNotifyPropertyChanged(TestObjectNotifyPropertyChanged other) { Watch(other, o => o.Number, nameof(Number)); }
public ObservableObjectLinkNotifyPropertyChanged(TestObjectNotifyPropertyChanged other) { Link(other, o => o.Number, () => Number); }