title: How do I test Prism event aggregator subscriptions, on the UIThread?
body: <p>I have a class, that subscribes to an event via PRISMs event aggregator.</p>
  
  <p>As it is somewhat hard to mock the event aggregator as noted <a href="https://stackoverflow.com/questions/1187269/why-does-my-moq-ieventaggregator-verification-fail">here</a>, I just instantiate a real one and pass it to the system under test.</p>
  
  <p>In my test I then publish the event via that aggregator and then check how my system under test reacts to it. Since the event will be raised by a FileSystemWatcher during production, I want to make use of the automatic dispatch by subscribing on the UIThread, so I can update my UI once the event is raised.</p>
  
  <p>The problem is, that during the test, the event never gets noticed in the system under test unless I don't subscribe on the UIThread. </p>
  
  <p>I am using MSpec for my tests, which I run from inside VS2008 via TDD.Net.
  Adding <code>[RequiresSta]</code> to my test class didn't help</p>
  
  <p>Does anyone have a solution, that saves me from changing the ThreadOption during my tests (e.g. via a property - what an ugly hack)???</p>