如果将您的库创建为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