I have the following four tests and the last one hangs when I run it. Why does this happen:
[Test]
public void CheckOnceResultTest()
{
Assert.IsTrue(Check
You're running into the standard deadlock situation that I describe on my blog and in an MSDN article: the async
method is attempting to schedule its continuation onto a thread that is being blocked by the call to Result
.
In this case, your SynchronizationContext
is the one used by NUnit to execute async void
test methods. I would try using async Task
test methods instead.