[dotnet-client] Help mocking IModel.BasicPublish

22 views
Skip to first unread message

Mark Snelling

unread,
May 24, 2013, 12:02:12 PM5/24/13
to rabbitmq...@googlegroups.com
Hello,

I'm writing unit tests for the various components in my application, some of which interface with a RabbitMQ broker.

I've managed to successfully implement reading from a mocked call to IModel.BasicConsume() and acknowledging with IModel.BasicAck() but am stuck on IModel.BasicPublish(), in particular mocking the ack/nack mechanism with IModel as I need to test my component in both those scenarios.

How does the ack/nack mechanism work with IModel.WaitForConfirms() and how would I go about sending an ack/nack when the publisher calls IModel.BasicPublish()?

I'm using NSubstitute as my mocking library but I imagine the solution is translatable across mocking frameworks.

Thanks,

Mark
Reply all
Reply to author
Forward
0 new messages