Test on Metro Style class library with Async/Await not working

I have a problem running a test when referencing a metro style class library and using async/await.  

1) I have a class library (A.dll) that has a method marked with 'async'
2) I also have a test project (produces TestA.dll) to test the A.dll with a [Test] marked with 'async' that calls the method in (1) with 'await'.

When I run the test I see two issues:

1) I cannot debug the values returned from an 'await' call.  When I attempt to look at a value I see "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack".  All of my projects are in the 'Debug' project configuration.

2) Sometimes while debugging a method using 'await' all of a sudden I can't debug over the code and the tests stops.  No exceptions are thrown and the test just passes (my guess is that the assert is not even executed).

Is this an issue with the Resharper test runner in VS 2012?

I'm using -
  Windows 8 Pro
  Visual Studio 2012 Ultimate
  NUnit 2.6.1
  Resharper 7.1 (downloaded and installed the latest '03 Oct 2012' EAP from http://confluence.jetbrains.net/display/ReSharper/ReSharper+7.1+Nightly+Builds)

Comment actions Permalink

Can someone help out?  Most of the development in metro/winRT has to be asynchronous and async/await is the right way to do it.
Can I provide more information to help out the Resharper devs?

Comment actions Permalink

Bummer - it looks like async/await is not supported by NUnit at this time
See http://stackoverflow.com/questions/12191831/how-do-i-test-an-async-method-with-nunit-eventually-with-another-framework

The first workaround of calling task.wait(); worked for me.


Please sign in to leave a comment.