Came across this handy technique for testing that methods are raising the correct events. I hope its of use.
[TestMethod]public void RaisesMyEventCorrectly(){ bool lRaised; MyObject obj = new MyObject; obj.MyEvent += delegate { lRaised = true; }; MyObjectWithEvents.Method();
Assert.IsTrue(lRaised, "MyEvent did not fire as expected.");}