Unit testing a IConsumer<> with exception testing

846 views
Skip to first unread message

Kent Hansen

unread,
Aug 2, 2018, 2:53:02 PM8/2/18
to masstransit-discuss
Would someone be so kind as to point me to an example unit test for an IConsumer where you are expecting the consumer to throw an exception and wish to validate that it has done so?
I've looked around the code base and poked at it with a stick all day and am making very little progress.
I got "regular" testing of the consumer to work using the InMemoryTestHarness (for whatever reason couldn't get the InMemoryTestFixture to actually cause the consumer to consume).
I'd be happy with either style of test however.

Thanks,
Kent

Chris Patterson

unread,
Aug 2, 2018, 5:21:44 PM8/2/18
to masstrans...@googlegroups.com
Consider this cause where the Fault<T> is consumed on a separate endpoint, to ensure the consumer faulted.



--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/ff4d8bab-4497-4d01-bce6-824ca649637f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kent Hansen

unread,
Aug 3, 2018, 10:01:10 AM8/3/18
to masstransit-discuss
Thanks for the quick tip Chris. I will check it out.


On Thursday, August 2, 2018 at 4:21:44 PM UTC-5, Chris Patterson wrote:
Consider this cause where the Fault<T> is consumed on a separate endpoint, to ensure the consumer faulted.


On Thu, Aug 2, 2018 at 1:53 PM, Kent Hansen <kent....@gmail.com> wrote:
Would someone be so kind as to point me to an example unit test for an IConsumer where you are expecting the consumer to throw an exception and wish to validate that it has done so?
I've looked around the code base and poked at it with a stick all day and am making very little progress.
I got "regular" testing of the consumer to work using the InMemoryTestHarness (for whatever reason couldn't get the InMemoryTestFixture to actually cause the consumer to consume).
I'd be happy with either style of test however.

Thanks,
Kent

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages