Isolator 5.4.2.0
[TestMethod(), Isolated]
public void Reset_Test()
{
_Code.Done += new Code.DoneEventHandler (TestDone);
_TestTrigger = new AutoResetEvent(false);
_TestTrigger.Reset();
_Code.Reset();
_TestTrigger.WaitOne();
_Code.Done -= TestDone;
}
void TestDone(Object o, EventArgs args)
{
_TestTrigger.Set();
}
_Code.Reset() calls a method that spawns a new thread. This new thread then ends with
_mainThreadDispatcher.BeginInvoke(DispatcherPriority.Normal,
(ThreadStart)delegate()
{
if (Done != null)
{
Done(this, new MyEventArgs());
}
});
When processing gets here, I can see that Done has the correct handler on it from the test. But control returns to the test seemingly without actually calling the handler. So the test spins in WaitOne()