You can use constructor injection using the following syntax:
Test.Handler<YourMessageHandler>(bus => new YourMessageHandler(dep1, dep2))
Where dep1 and dep2, in all likelihood, are just some of the stubs or jokes that your mocking structure has prepared for you.
- Updated Udi Dahan from here:
You can access the mocked bus instance through Test.Bus.
source share