var ibus = Substitute.For<IBus>();
_myService.DoSomething(objectWithSomeParams); //this one calls IBus.Send(MyMessage) ibus.Received().Send(Arg.Any<MyMessage>());
var endpointInstance = Substitute.For<IEndpointInstance>();
_myService.DoSomething(objectWithSomeParams); //this one calls IEndpointInstance.Send(MyMessage)
endpointInstance.Received().Send(Arg.Any<MyMessage>());
//throws following exception:
(System.ArgumentNullException : Value cannot be null.
Parameter name: message
at NServiceBus.IMessageSessionExtensions.Send(IMessageSession session, Object message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\IMessageSessionExtensions.cs:line 19)
var testableEndpointInstance = new TestableEndpointInstance();
_myService.DoSomething(objectWithSomeParams); //this one calls IEndpointInstance.Send(MyMessage)
var sentMessages = testableEndpointInstance.SentMessages;
sentMessages.Length.ShouldBe(1);
sentMessages[0].Message.ShouldBeOfType<MyMessage>();
Hi ivan,
We recently moved our community platform to https://discuss.particular.net. The Google Group will be locked down very soon. This means there is a chance that you won't get many responses to your question here.
The easiest way to get this question answered is by joining us on https://discuss.particular.net and reposting your question. That way you'll be automatically able to follow any replies.
We apologize for the inconvenience but hope that you will enjoy our new community platform as much as we do!
Best Regards,
Daniel
P.S. For more details about the new discussion group, see our announcement here: https://groups.google.com/forum/#!topic/particularsoftware/gjVrM5radzk.