Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run unit tests for Xamarin library projects (iOS and Android)?

I'm creating a component for the Xamarin Component Store, providing a Library for Android and iOS. I've put NUnit tests into both library projects but I can't run the unit tests. Is it possible to execute tests in a Android/iOS library project?

like image 275
Rodja Avatar asked Mar 23 '23 19:03

Rodja


1 Answers

If you make your library a PCL, you can create a NUnit project that links to the PCL and run your tests that way: https://dzwonsemrish7.cloudfront.net/items/0H3W383D2e031q1p3s40/Screen%20Shot%202013-08-12%20at%207.56.05%20PM.png?v=d5aac873

Xamarin also provides a NUnitLite test runner for iOS: http://docs.xamarin.com/guides/ios/deployment,_testing,_and_metrics/touch.unit

With the latest version of Xamarin Studio you can also create an Android Unit Test project: https://dzwonsemrish7.cloudfront.net/items/3v3x192S473g182C2S2a/Screen%20Shot%202013-08-12%20at%207.55.41%20PM.png?v=f0dce0f9

like image 61
Ben Bishop Avatar answered Mar 25 '23 11:03

Ben Bishop