public void BusShouldReportShutdownWhenMessageSinkReturnsFalse()
 {
     using (var bus = new SynchronousMessageBus(SpyMessageSink.Create(returnResult: false)))
     {
         Assert.False(bus.QueueMessage(Substitute.For<IMessageSinkMessage>()));
     }
 }
    public void MessagesAreDispatchedImmediatelyFromBus()
    {
        var msg1 = Substitute.For<IMessageSinkMessage>();
        var dispatchedMessages = new List<IMessageSinkMessage>();
        using (var bus = new SynchronousMessageBus(SpyMessageSink.Create(messages: dispatchedMessages)))
        {
            Assert.True(bus.QueueMessage(msg1));
        }

        Assert.Collection(dispatchedMessages, message => Assert.Same(msg1, message));
    }