title: Raising delegate events in Moq
body: <p>in my moq setup, i want to raise a delegate event. How do i do this?</p>
  
  <p>To be tested:</p>
  
  <pre><code>public class SomeClassToBeTested
  {
     public void SomeMethodToTest()
     {
        var event = new ThreadStart(someOtherClass.SomeMethod);
        someOtherClass.SomeDelegate += new SomeOtherClass.someDelegate(TriggerMethod);
     }
  
     public void TriggerMethod()
     {
        // do something 
     }
  }
  </code></pre>
  
  <p>Test class:</p>
  
  <pre><code>[Test]
  public void SomeTest()
  {
     this.moqSomeOtherClass.Setup(fd =&gt; fd.SomeMethod())
                           .Raises(fd =&gt; // trigger delgate);
  }
  </code></pre>