How do I unit testing a class which makes use of System.Windows.Threading.Dispatcher
?
I am following the MVVM pattern in the setting of WPF. As part of this I am creating a DispatchingBlah
class following the pattern used for DispatchingQuoteSource
that I saw in this video (see 1:06:16 ish).
I want to test that my class has queued the correct things to the dispatcher object, but I'm having trouble figuring out how to do that. There is no way for me (as far as I can find) to synchronously flush out the queue in order to see the effects of the queued objects. Nor can I see how to query the queue to inspect what has been added.
Do I need to concoct some interface around the System.Windows.Threading.Dispatcher
class?