Hi I have encountered what I think is a bug.
I would expected the following unit test to pass. It does not.
The example is distilled from a more complex case.
Is it not supported to have other threads create mocks?
[Fact]
public async Task Fails()
{
var iTask = Task.Run(() => Mock.Create<I>());
var i = await iTask;
EA expectedArgs = new EA();
EA receivedArgs = null;
i.Done += (sender, ea) => receivedArgs = ea;
i.Raise(x => x.Done += null, expectedArgs);
Assert.Equal(expectedArgs, receivedArgs);
}
public class EA : EventArgs
{
}
public interface I
{
event EventHandler<EA> Done;
}