Example #1
0
        public void BaseBus_Send_Ok()
        {
            var bus = new BaseBus();

            string value = Guid.NewGuid().ToString();

            var handler = new TestHandler1();

            bus.Subscribe(handler);
            bus.Publish(new TestMessage()
            {
                Data = value
            });

            Assert.True(handler.Data == value);
        }
Example #2
0
        public void BaseBus_Send_MultipleMessages_Ok()
        {
            var bus = new BaseBus();

            var handler1 = new TestHandler1();

            bus.Subscribe(handler1);

            Enumerable.Repeat <Action>(() =>
            {
                string value = Guid.NewGuid().ToString();

                bus.Publish(new TestMessage()
                {
                    Data = value
                });

                Assert.True(handler1.Data == value);
            }, 10);
        }