예제 #1
0
 public void NormalAsync()
 {
     Flowable.ConcatEager(
         Flowable.Range(1, 1000).SubscribeOn(Executors.Task)
         , Flowable.Range(1001, 1000).SubscribeOn(Executors.Task))
     .Test()
     .AwaitDone(TimeSpan.FromSeconds(5))
     .AssertSubscribed()
     .AssertValueCount(2000)
     .AssertComplete()
     .AssertNoError()
     .With(ts =>
     {
         var list = ts.Values;
         for (int i = 1; i <= 2000; i++)
         {
             if (list[i - 1] != i)
             {
                 ts.Fail("Elements differ: Expected = " + i + ", Actual = " + list[i - 1]);
             }
         }
     });
 }
예제 #2
0
        public override IPublisher <int> CreatePublisher(long elements)
        {
            int half = (int)elements / 2;

            return(Flowable.ConcatEager(Flowable.Range(1, half).Hide(), Flowable.Range(half, (int)elements - half).Hide()));
        }
예제 #3
0
 public void NormalHidden()
 {
     Flowable.ConcatEager(Flowable.Range(1, 2).Hide(), Flowable.Range(3, 3).Hide())
     .Test()
     .AssertResult(1, 2, 3, 4, 5);
 }