4

我正在为 Xamarin 组件商店创建一个组件,为 Android 和 iOS 提供一个库。我已将 NUnit 测试放入两个库项目中,但我无法运行单元测试。是否可以在 Android/iOS 库项目中执行测试?

4

1 回答 1

7

如果您将库设为 PCL,则可以创建一个链接到 PCL 的 NUnit 项目并以这种方式运行您的测试: https ://dzwonsemrish7.cloudfront.net/items/0H3W383D2e031q1p3s40/Screen%20Shot%202013-08-12% 20at%207.56.05%20PM.png?v=d5aac873

Xamarin 还为 iOS 提供了 NUnitLite 测试运行程序:http: //docs.xamarin.com/guides/ios/deployment,_testing,_and_metrics/touch.unit

使用最新版本的 Xamarin Studio,您还可以创建 Android 单元测试项目: https ://dzwonsemrish7.cloudfront.net/items/3v3x192S473g182C2S2a/Screen%20Shot%202013-08-12%20at%207.55.41%20PM.png ?v=f0dce0f9

于 2013-08-13T00:56:36.227 回答