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

那年仲夏 提交于 2020-01-13 11:13:45

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/18175191/how-to-run-unit-tests-for-xamarin-library-projects-ios-and-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!