示例#1
0
        public void scheduler_is_used_for_first_subscription()
        {
            var sourceA = new StatsSubject<int>();
            var sourceB = Observable.Empty<int>();

            var scheduler = new ManualScheduler();
            var stats = new StatsObserver<int>();

            sourceA.Concat(sourceB, scheduler).Subscribe(stats);

            Assert.AreEqual(0, sourceA.SubscriptionCount);
            Assert.AreEqual(1, scheduler.QueueSize);

            scheduler.RunNext();

            Assert.AreEqual(1, sourceA.SubscriptionCount);
            Assert.AreEqual(0, scheduler.QueueSize);
        }
示例#2
0
        public void scheduler_is_used_for_first_subscription()
        {
            var sourceA = new StatsSubject <int>();
            var sourceB = Observable.Empty <int>();

            var scheduler = new ManualScheduler();
            var stats     = new StatsObserver <int>();

            sourceA.Concat(sourceB, scheduler).Subscribe(stats);

            Assert.AreEqual(0, sourceA.SubscriptionCount);
            Assert.AreEqual(1, scheduler.QueueSize);

            scheduler.RunNext();

            Assert.AreEqual(1, sourceA.SubscriptionCount);
            Assert.AreEqual(0, scheduler.QueueSize);
        }