Why would one need "async" support for MS Unit Test if Task.Result can be used?

Viewed 211

I'm a bit puzzled here...I have a test method which does a call to an async method and I changed the signature to async Task. Works.

[TestMethod]
public async Task TestIt()
{
  bool result = await service.SomethingAsync();
  Assert(result);
}

Now I read all over the web that support for async is required in unit tests and is now also in NUnit. But why is that so important? I can write the test like this, using the Result property which will wait for Task completion:

[TestMethod]
public void TestIt()
{
  bool result = service.SomethingAsync().Result;
  Assert(result);
}
1 Answers
Related