简体   繁体   中英

ReSharper Unit Test Runner - TestCase

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.

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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