Comment 8 for bug 1057981

Revision history for this message
Simone Busoli (simone.busoli) wrote : Re: [Bug 1057981] Re: C#5 async tests are not supported

Charlie, I think this bug is not about asynchronous tests, but rather about
correct handling of tests which have to be marked as async because they use
the new .NET 4.5 async/await features, which is a different matter as far
as I understand.

Also, I'm not completely sure that although this feature has been
introduced in .NET 4.5 it cannot be handled somehow in CLR 2.0, but I will
have to check further as I'm not overly familiar with the brand new
features.

In any case, it would be quite good if this was possible to handle it in
NUnit 2.x which is the current released version, as users otherwise would
have to wait until 3.0 is out or switch to NUnitLite, which if I were a
user I would like to not need to do.

If not possible then the workaround is quite simple and just requires the
users to Wait on the task by caling its waiting method, rather than
"awaiting" it.

On Fri, Sep 28, 2012 at 5:26 PM, Charlie Poole <email address hidden> wrote:

> I upgraded NUnitLite fix to High priority because it would enable us to
> support async methods in the NUnit test adapter that runs under VS 2012.
> That adapter is currently based on the full NUnit framework, but I was
> planning to switch it over to NUnitLite as soon as the latter reached
> feature parity with NUnit.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1057981
>
> Title:
> C#5 async tests are not supported
>
> Status in NUnit Test Framework:
> Triaged
> Status in NUnitLite Testing Framework:
> Triaged
>
> Bug description:
> If a method is marked async, nunit does not recognise it as a test,
> and some test runners may incorrectly pass it while it is still
> running. These methods actually return a Task not void, and the test
> can only be passed if the task completes without a failure.
>
> As detailed here http://anthonysteele.co.uk/async-and-await-with-nunit
>
> MSTest supports async tests
>
> http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/13/what-s-new-for-mstest-unit-tests-in-visual-studio-11-beta.aspx
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunit-3.0/+bug/1057981/+subscriptions
>