public void Lockstep() { var dp1 = new DirectProcessor <int>(); var dp2 = new DirectProcessor <int>(); TestSubscriber <int> ts = dp1.Sample(dp2).Test(); ts.AssertEmpty(); dp1.OnNext(1); dp1.OnNext(2); dp2.OnNext(100); ts.AssertValues(2); dp2.OnNext(100); ts.AssertValues(2); dp1.OnNext(3); dp1.OnNext(4); dp2.OnNext(200); ts.AssertValues(2, 4); dp2.OnComplete(); ts.AssertResult(2, 4); Assert.IsFalse(dp1.HasSubscribers); Assert.IsFalse(dp2.HasSubscribers); }
public void Normal() { var ts = new TestSubscriber <int>(); Flowable.Range(1, 10) .BlockingSubscribe(ts); ts.AssertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); }
public void NormalAsync() { var ts = new TestSubscriber <int>(); Flowable.Range(1, 10) .Delay(TimeSpan.FromMilliseconds(10)) .BlockingSubscribe(ts); ts.AssertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); }
public void NormalLambda() { var ts = new TestSubscriber <int>(); ts.OnSubscribe(new BooleanSubscription()); Flowable.Range(1, 10) .BlockingSubscribe(ts.OnNext, ts.OnError, ts.OnComplete); ts.AssertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); }
public void NormalLambdaAsync() { var ts = new TestSubscriber <int>(); ts.OnSubscribe(new BooleanSubscription()); Flowable.Range(1, 10) .Delay(TimeSpan.FromMilliseconds(10)) .BlockingSubscribe(ts.OnNext, ts.OnError, ts.OnComplete); ts.AssertResult(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); }