public void Backpressure()
        {
            var pp = new PublishProcessor <int>();

            pp.Start();

            var ts1 = pp.Test(20);

            pp.OnNext(1);
            pp.OnNext(2);

            ts1.AssertValues(1, 2);

            var ts2 = pp.Test(0);

            ts2.AssertValues();

            pp.OnNext(3);

            ts1.AssertValues(1, 2);
            ts2.AssertValues();

            ts2.Request(10);

            ts1.AssertValues(1, 2, 3);
            ts2.AssertValues(3);
        }
        public void Normal()
        {
            var dp = new PublishProcessor <int>();

            dp.Start();
            Assert.IsFalse(dp.HasSubscribers);

            var ts = dp.Test();

            Assert.IsTrue(dp.HasSubscribers);

            dp.OnNext(1);
            dp.OnNext(2);
            dp.OnNext(3);
            dp.OnNext(4);

            ts.AssertValues(1, 2, 3, 4);

            dp.OnComplete();

            ts.AssertResult(1, 2, 3, 4);
        }
        public void Error2()
        {
            var pp = new PublishProcessor <int>();

            pp.Start();

            var ts1 = pp.Test();
            var ts2 = pp.Test();

            pp.OnNext(1);
            pp.OnError(new Exception());

            ts1.AssertFailure(typeof(Exception), 1);
            ts2.AssertFailure(typeof(Exception), 1);
        }