Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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();
 }