Beispiel #1
0
        public void Should_request_an_instance_of_the_consumer_for_each_message()
        {
            var called = new FutureMessage <PingMessage>();

            var ping = new PingMessage();

            var getter = MockRepository.GenerateMock <HandlerSelector <PingMessage> >();

            getter.Expect(x => x(null)).IgnoreArguments().Return(x => called.Set(x.Message));

            LocalBus.SubscribeHandlerSelector(getter);

            LocalBus.Publish(ping);

            called.IsAvailable(3.Seconds()).ShouldBeTrue();
        }