title: How to verify event subscribed using Moq
body: <p>I am using MVVM pattern and silverlight 4.0 and Moq for testing.
  In the view model constructor, am passing an IEventAggregator object. This object is used to subscribe to an event called SelectionChangedEvent.</p>
  
  <p>In the test method I am doing like this:</p>
  
  <pre><code>this.selectedEvent = new Mock&lt;SelectionChangedEvent&gt;();
  this.eventAggregator.Setup(x =&gt; x.GetEvent&lt;SelectionChangedEvent&gt;()).Returns(this.selectedEvent.Object);
  var viewModel = new ViewModel(this.eventAggregator);
  </code></pre>
  
  <p>I want to test that the event is getting subscribed when the constructor is called.
  How can I verify this?</p>