Beispiel #1
0
        public void ShouldIncreaseStubFiberSubscriberCountByOne()
        {
            var fiber = new StubFiber();
            fiber.Start();
            var channel = new Channel<int>();

            Assert.AreEqual(0, fiber.SubscriptionsCount);
            Assert.AreEqual(0, channel.SubscribersCount);
            channel.Subscribe(fiber, x => { });

            Assert.AreEqual(1, fiber.SubscriptionsCount);
            Assert.AreEqual(1, channel.SubscribersCount);
            fiber.Dispose();

            Assert.AreEqual(0, fiber.SubscriptionsCount);
            Assert.AreEqual(0, channel.SubscribersCount);
        }
 protected override void SetUp()
 {
     _fiber = new StubFiber();
     _fiber.Start();
 }