Touch.Unit vs NUnitLite 1.0

In case you have not noticed NUnitLite has picked up speed in the last few months.

Xamarin.iOS 7.0 shipped with NUnitLite 0.9 – itself announced right before WWDC2013, i.e. when the 6.9 series began its summer-alpha life. Then just a few days before iOS7 went gold (and way too close to update it) the one-dot-oh version was released.

NUnitLite has grown quite a lot since we started using the 0.6 version two years ago. IMHO the most recent and exciting enhancement is related to async test support. That’s something I missed a lot from the Silverlight test harness we used back then for Moonlight.



What’s presently shipping with Xamarin.iOS 7.0 already has support for async tests – but don’t stop reading yet! Still there are a few issues because the runner (Touch.Unit) needs to run some code on the main (UI) thread – which was never an issue before executing async tests (yep, that means testing the test runner). The known issues were fixed along with the update to 1.0, so stuff like this will now work as expected:

[Test]
public async Task NestedAsync ()
{
   // thanks to Greg Shackles for this small gem
   await Task.Run (async () => {
      await Task.Delay (1000);
   });
   Assert.Pass ("Delayed");
}

So if you’re curious about the latest features (async or not) and can’t wait for the next Xamarin.iOS then I encourage you to try it today right off my github repositories for Touch.Unit (the iOS based runner) and NUnitLite. Please file any issue so we can make 1.0 shine in a future release of Xamarin.iOS!

About these ads

About spouliot

Xamarin Hacker, Mono Contributor, Open Source Enthusiast with strong interests in Code Analysis, Cryptography and Security. Presently working on MonoTouch, previous projects were Moonlight and libgdiplus and a lot of the cryptographic work done on Mono.
This entry was posted in mono, monotouch, touch.unit, xamarin. Bookmark the permalink.

2 Responses to Touch.Unit vs NUnitLite 1.0

  1. Awesome, I was hitting this bug as well when trying to test ModernHttpClient on iOS, since AFNetworking delivers results to the main thread

  2. spouliot says:

    Timely update :-) Please let me know if it works fine or file any remaining issue(s)!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s