Example #1
0
        public void when_two_subscriptions_of_T_are_made_and_Push_of_T_is_called_then_each_subscription_is_called()
        {
            var messageStream = new MessageStream();

            var result1 = false;

            messageStream.Of<bool>()
                         .Subscribe(x => result1 = true);

            var result2 = false;

            messageStream.Of<bool>()
                         .Subscribe(x => result2 = true);

            messageStream.Push(true);

            Assert.That(result1, Is.True);
            Assert.That(result2, Is.True);
        }
Example #2
0
        public void when_two_subscriptions_of_T_are_made_and_Push_of_T_is_called_then_each_subscription_is_called()
        {
            var messageStream = new MessageStream();

            var result1 = false;

            messageStream.Of <bool>()
            .Subscribe(x => result1 = true);

            var result2 = false;

            messageStream.Of <bool>()
            .Subscribe(x => result2 = true);

            messageStream.Push(true);

            Assert.That(result1, Is.True);
            Assert.That(result2, Is.True);
        }
Example #3
0
        public void when_a_subscription_of_T_is_made_and_Push_of_T_is_called_twice_then_the_subscription_is_called_twice()
        {
            var messageStream = new MessageStream();

            var result = 1;

            messageStream.Of<bool>()
                         .Subscribe(x => result++);

            messageStream.Push(true);

            Assert.That(result, Is.EqualTo(2));
        }
Example #4
0
        public void when_a_subscription_of_T_is_made_and_Push_of_T_is_called_then_the_subscription_is_called()
        {
            var messageStream = new MessageStream();

            var result = false;

            messageStream.Of<bool>()
                         .Subscribe(x => result = true);

            messageStream.Push(true);

            Assert.That(result, Is.True);
        }
Example #5
0
        public void when_a_subscription_of_T_is_made_and_Push_of_T_is_called_twice_then_the_subscription_is_called_twice()
        {
            var messageStream = new MessageStream();

            var result = 1;

            messageStream.Of <bool>()
            .Subscribe(x => result++);

            messageStream.Push(true);

            Assert.That(result, Is.EqualTo(2));
        }
Example #6
0
        public void when_a_subscription_of_T_is_made_and_Push_of_T_is_called_then_the_subscription_is_called()
        {
            var messageStream = new MessageStream();

            var result = false;

            messageStream.Of <bool>()
            .Subscribe(x => result = true);

            messageStream.Push(true);

            Assert.That(result, Is.True);
        }