ReSharper Unit Test Runner - TestCase

半世苍凉 提交于 2019-12-18 19:40:22

问题


I like using the ReSharper unit test runner, but it doesn't support the TestCase attribute that was added in NUnit 2.5. Is there any hack to get round this?

I can obviously use another test runner, but I like the ReSharper one.


回答1:


I love ReSharper, but it does not yet support [TestCase]. However, take a look at the Gallio plug-in for ReSharper which does.

http://www.gallio.org/




回答2:


Another solution that I use on Resharper version 5 is to use aspects with your tests. I'd love resharper 6 but upgrading isn't an option for me currently.

You can use PostSharp to create an aspect that does something as simple as simple as printing out the arguments list to the console every time the unit test is run. When you runt his with the resharper runner in visual studio, if it fails, it will have print out what the arguments were in the output panel. This way you know which test failed. If you use an aspect you can then re-use this on any test that uses TestCases without having to write your printing statement each time.



来源:https://stackoverflow.com/questions/1479075/resharper-unit-test-runner-testcase

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