public void OFPShouldWorkWithINPCObjectsToo() { new TestScheduler().With( sched => { var fixture = new NonReactiveINPCObject { InpcProperty = null }; var changes = fixture.ObservableForProperty(x => x.InpcProperty.IsOnlyOneWord).CreateCollection(scheduler: ImmediateScheduler.Instance); fixture.InpcProperty = new TestFixture(); sched.Start(); Assert.Equal(1, changes.Count); fixture.InpcProperty.IsOnlyOneWord = "Foo"; sched.Start(); Assert.Equal(2, changes.Count); fixture.InpcProperty.IsOnlyOneWord = "Bar"; sched.Start(); Assert.Equal(3, changes.Count); }); }
public void OFPShouldWorkWithINPCObjectsToo() { (new TestScheduler()).With(sched => { var fixture = new NonReactiveINPCObject() { InpcProperty = null }; var changes = fixture.ObservableForProperty(x => x.InpcProperty.IsOnlyOneWord).CreateCollection(); fixture.InpcProperty = new TestFixture(); sched.Start(); Assert.Equal(1, changes.Count); fixture.InpcProperty.IsOnlyOneWord = "Foo"; sched.Start(); Assert.Equal(2, changes.Count); fixture.InpcProperty.IsOnlyOneWord = "Bar"; sched.Start(); Assert.Equal(3, changes.Count); fixture.InpcProperty = new TestFixture() {IsOnlyOneWord = "Bar"}; sched.Start(); Assert.Equal(4, changes.Count); }); }