NServiceBus/NServiceBus — Issue #205: Testing framework does not enforce message rules (ICommand)
Author: sliedig
Created: 2012-02-29 07:02:41+00:00
State: open

Hello,

We're currently undergoing an upgrade of our solution to V3 and have found a potential missing feature in the testing framework, specifically related to new ICommand message type. The new types are there to enforce the architectural principals of the framework, and this is why we are updating our message types. However, after mistakenly labelling one of our internal messages with ICommand, rather than leaving it as IMessage, we we getting the following exception.

------------------
2012-02-28 11:29:30,084 [Worker.9] WARN NServiceBus.Unicast.UnicastBus [(null)] <(null)> - CreateSiteRequestHandler failed handling message.
System.InvalidOperationException: Reply is not supported for Commands. They should be be sent to their logical owner using bus.Send
------------------

This was only apparent at runtime. The tests we have for the handler passed without fail, which is why we didn't catch it before. Should this not be something the testing framework catches?