简体   繁体   English

从Main方法/ MonoDevelop内运行XUnit.Net测试

[英]Running XUnit.Net tests from Main Method / Within MonoDevelop

I am trying to use xUnit.net to test a project I wrote in Mono on OSX. 我正在尝试使用xUnit.net来测试我在OSX上用Mono编写的项目。 I wannt good way to run the tests in MonoDevelop or at least a way to create a test suite and run these tests from a main method of the project. 我很好地在MonoDevelop中运行测试,或者至少是一种创建测试套件的方法,并从项目的主要方法运行这些测试。 Has anyone tried doing this? 有没有人试过这样做? I remember in NUnit I would be able to create test suites and run them myself but I am not able to figure out how to do the equivalent in xUnit.net. 我记得在NUnit中我可以自己创建测试套件并运行它们,但我无法弄清楚如何在xUnit.net中进行等效操作。

Let me know if anyone has found a good way to run tests without using a runner in xUnit.net or a better way to run tests in OSX MonoDevelop. 让我知道是否有人找到了一种在xUnit.net中不使用跑步者的情况下运行测试的好方法,或者是在OSX MonoDevelop中运行测试的更好方法。

You can run your tests using xunit gui (use mono xunit.gui.flavor from terminal) - I'm not aware of an xunit addin for MonoDevelop that could integrate an xunit test runner into the MonoDevelop IDE (another reference: http://xunit.codeplex.com/discussions/439410 ). 您可以使用xunit gui运行测试(使用来自终端的mono xunit.gui.flavor) - 我不知道MonoDevelop的xunit插件可以将xunit测试运行器集成到MonoDevelop IDE中(另一个参考: http:// xunit.codeplex.com/discussions/439410 )。

To debug your unit tests, you can attach the debugger to the xunit gui. 要调试单元测试,可以将调试器附加到xunit gui。 To make this simpler, you can customize the projects run configuration: http://www.grumpydev.com/2011/06/30/debugging-xunit-tests-using-monodevelop/ 为了使这更简单,您可以自定义项目运行配置: http//www.grumpydev.com/2011/06/30/debugging-xunit-tests-using-monodevelop/

It's a decision you have to make whether you want to jump through a few hoops to use xunit or just use NUnit that's integrated well with the platform. 这是一个决定,你必须做出是否要跳过几个箍使用xunit或只是使用与平台集成良好的NUnit。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM