Created
January 15, 2010 15:13
-
-
Save mxriverlynn/278116 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ServiceBusExtensions | |
{ | |
public static bool HasSubscribersFor<T>(this IServiceBus serviceBus, T message) | |
{ | |
IEnumerable<Action<object>> enumerable = serviceBus.OutboundPipeline.Enumerate(message); | |
return enumerable.Count() > 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IServiceBus BuildServiceBus() | |
{ | |
var serviceBus = Mock<IServiceBus>(); | |
var messagePipeline = Mock<IMessagePipeline>(); | |
var messageHandlers = new Action<Object>[1]; | |
messagePipeline.Stub(m => m.Enumerate(null)) | |
.IgnoreArguments() | |
.Return(messageHandlers); | |
serviceBus.Stub(s => s.OutboundPipeline).Return(messagePipeline); | |
return serviceBus; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceBusExtensions | |
def HasSubscribersFor(*args) | |
return true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment