예제 #1
0
        public void An_unsubscribed_does_not_receive_the_Put_element()
        {
            var s    = new CountableStack <int>(3);
            var sub1 = new StackSubscriber <int>();
            var sub2 = new StackSubscriber <int>();

            s.Subscribe(sub1);
            s.Subscribe(sub2);
            s.Put(40);
            s.Unsubscribe(sub1);
            s.Put(41);
            Assert.AreEqual(40, sub1.LastPut);
            Assert.AreEqual(41, sub2.LastPut);
        }