Unit testing and the message bus

Aug 16, 2012 at 10:26 PM

I am unit testing some view models and ran into a problem.  The first unit test that sends a message on the bus to the view model being tested succeeds, but subsequent tests that send messages fail -- the view model acts like it never received the message.

There is a more detailed explanation at http://stackoverflow.com/questions/11992200/mvvm-unit-tests-message-bus-only-works-once

This is a bit of a problem because there are several blocks of code that only execute when a message is received so sending a message is the only way I can test it.  Any ideas as to what is going on?