← Back to team overview

nunit-core team mailing list archive

Re: [Bug 1057981] Re: C#5 async tests are not supported

 

Hi Anthony, yes, if you have had any experience with implementing I'd
appreciate if you could have a look at the branch where I've implemented
it. A nice addition is that it would also now be possible to do this:

[TestCase(Result = 1)]
public async Task<int> Do()
{
    return await Task.FromResult(1);
}

On Mon, Oct 1, 2012 at 11:28 AM, Anthony Steele <Anthony.Steele@xxxxxxxxxxxx
> wrote:

> @Charlie: You're right, task return type only helps if you are targeting
> .Net 4.0 or up.
>
> I see you guys have goten quite far with this already. :)
>
> --
> 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
> Status in NUnit V2 Test Framework:
>   In Progress
>
> 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
>

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
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
Status in NUnit V2 Test Framework:
  In Progress

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


References