public void Basic() { MaybeSource.Timer(TimeSpan.FromMilliseconds(100), NewThreadScheduler.Default) .Test() .AwaitDone(TimeSpan.FromSeconds(5)) .AssertResult(0L); }
public void Other_Error() { MaybeSource.Error <int>(new InvalidOperationException()) .DelaySubscription(MaybeSource.Timer(TimeSpan.FromMilliseconds(100), NewThreadScheduler.Default)) .Test() .AwaitDone(TimeSpan.FromSeconds(5)) .AssertFailure(typeof(InvalidOperationException)); }
public void Other_Basic() { MaybeSource.Empty <int>() .DelaySubscription(MaybeSource.Timer(TimeSpan.FromMilliseconds(100), NewThreadScheduler.Default)) .Test() .AwaitDone(TimeSpan.FromSeconds(5)) .AssertResult(); }
public void Other_Success() { MaybeSource.Just(1) .DelaySubscription(MaybeSource.Timer(TimeSpan.FromMilliseconds(100), NewThreadScheduler.Default)) .Test() .AwaitDone(TimeSpan.FromSeconds(5)) .AssertResult(1); }
public void Dispose() { var sch = new TestScheduler(); var to = MaybeSource.Timer(TimeSpan.FromMilliseconds(100), sch) .Test(); Assert.True(sch.HasTasks()); sch.AdvanceTimeBy(50); Assert.True(sch.HasTasks()); to.AssertEmpty(); sch.AdvanceTimeBy(50); Assert.False(sch.HasTasks()); to.AssertResult(0L); }