I came across the following bug report and discovered the solution to stop the touch runner freezing while running was to add a timeout attribute to the test. Whilst this does resolve the freezing issue and the test reports successful - 0 assertions are made.
public async Task AsyncTest()
await Task.Run(async() =>
I've just discovered changing the return type to async void rather than async task gets this working as expected and assertions are made.
However, shouldn't this still be the behaviour when returning a task?
I have checked this issue and I am able to reproduce this issue.
Steps I followed:
1. Created iOS unit test project.
2. Add a new test file and named it "Tests.cs".
3. Debug test on simulator.
4. Run created test "AsyncTest"
When I run the case with async and await keywords, I observed the assertions are never made. For the testing, I just write the assert statement before the await Task.Run() the assertion is working. However, assertions are working without the "async and await" keywords.
Mac OS X 10.9.3
Xamarin Studio: 5.3 (build 440)
Mono 3.8.0 ((no/62a857e)
Xcode 5.1 (5084)
Xamarin.iOS : 22.214.171.124
=== Build Information ===
Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859