Exemple #1
0
 public void Take()
 {
     Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3))
     .Take(4)
     .Test()
     .AssertResult(1, 2, 3, 4);
 }
Exemple #2
0
 public void Rebatch()
 {
     Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3))
     .RebatchRequests(1)
     .Test()
     .AssertResult(1, 2, 3, 4, 5, 6);
 }
Exemple #3
0
 public void NormalConditional()
 {
     Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3))
     .Filter(v => true)
     .Test()
     .AssertResult(1, 2, 3, 4, 5, 6);
 }
Exemple #4
0
        public void Cancel()
        {
            var dp = new DirectProcessor <int>();
            var ts = Flowable.Concat(dp).Test();

            Assert.IsTrue(dp.HasSubscribers);

            ts.Cancel();

            Assert.IsFalse(dp.HasSubscribers);
        }
Exemple #5
0
 public void Backpressure()
 {
     Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3))
     .Test(0)
     .AssertValues()
     .RequestMore(1)
     .AssertValues(1)
     .RequestMore(3)
     .AssertValues(1, 2, 3, 4)
     .RequestMore(2)
     .AssertResult(1, 2, 3, 4, 5, 6);
 }
Exemple #6
0
 public void Normal()
 {
     Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3))
     .Test()
     .AssertResult(1, 2, 3, 4, 5, 6);
 }
Exemple #7
0
        public override IPublisher <int> CreatePublisher(long elements)
        {
            long half = elements / 2;

            return(Flowable.Concat(Flowable.Range(0, (int)half), Flowable.Range((int)half, (int)(elements - half))).Filter(v => true));
        }