示例#1
0
        public void Regular_Step_InitialDelay()
        {
            var ts = new TestScheduler();

            var to = ObservableSource.IntervalRange(1, 5, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(1), ts)
                     .Test();

            to.AssertEmpty();

            ts.AdvanceTimeBy(5);

            to.AssertEmpty();

            ts.AdvanceTimeBy(5);

            to.AssertValuesOnly(1);

            ts.AdvanceTimeBy(2);

            to.AssertValuesOnly(1, 2, 3);

            ts.AdvanceTimeBy(2);

            to.AssertResult(1, 2, 3, 4, 5);
        }
示例#2
0
        public void Fused_Step_InitialDelay()
        {
            var ts = new TestScheduler();

            var to = ObservableSource.IntervalRange(1, 5, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(1), ts)
                     .Test(fusionMode: FusionSupport.Any)
                     .AssertFuseable()
                     .AssertFusionMode(FusionSupport.Async);

            to.AssertEmpty();

            ts.AdvanceTimeBy(5);

            to.AssertEmpty();

            ts.AdvanceTimeBy(5);

            to.AssertValuesOnly(1);

            ts.AdvanceTimeBy(2);

            to.AssertValuesOnly(1, 2, 3);

            ts.AdvanceTimeBy(2);

            to.AssertResult(1, 2, 3, 4, 5);
        }
示例#3
0
 public void Regular_Finite_Empty()
 {
     ObservableSource.IntervalRange(1, 0, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(1), ThreadPoolScheduler.Instance)
     .Test()
     .AwaitDone(TimeSpan.FromSeconds(5))
     .AssertResult();
 }
示例#4
0
 public void Fused_Finite_Empty()
 {
     ObservableSource.IntervalRange(1, 0, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(1), ThreadPoolScheduler.Instance)
     .Test(fusionMode: FusionSupport.Any)
     .AssertFuseable()
     .AssertFusionMode(FusionSupport.Async)
     .AwaitDone(TimeSpan.FromSeconds(5))
     .AssertResult();
 }