Xamarin (Android) Unit Tests in Visual Studio 2017

There are three basic levels of testing:

The classic unit testing of pure .Net/Mono code via xUnit|NUnit

  • Nothing new here, this is the same testing that .Net programmers have been doing all long and has nothing to do with the Xamarin platform frameworks

Note: These tests are totally independent of Xamarin.Android|iOS|Mac

On platform testing (including platform features)

Note: There are multiple on device testing wrappers for NUnit, XUnit, etc… Xamarin includes a NUnitLite version that runs on Android and iOS and that provide a device specific UI to run those tests. Xamarin has templates that create a Unit Test App project for Android or iOS.

Note: These tests can include platform dependent features (Networking, Bluetooth, GPS, SMS, etc… but no GUI related tests) and can also reference Nunit [Test]s written in PCL-based assemblies or platform-specific libraries.

Alternatives to NUnitLite:

UI Testing

A Casabash/Appium/… driven tests of the UI elements in your application and their reaction to input (touch) events.

  • Test Cloud/Mobile Center and/or other local, public or private mobile test clouds

  • Xamarin Test Cloud

Leave a Comment