Feature Suggestions

Support nunit [TestCase] attribute

Started by martinkruitz on 8,787 views

Hi,

In a previous post (5 months ago) from Yanglee talked about the ability to show markers in front of the TestCase attribute.
It would be nice to have these, it shortens test code enormously.
Hi, thanks for posting!

I did look into doing this, as there would be clear value behind such a feature. However, the reason it hasn't been implemented is because it is really, really, really hard to do. Currently NCrunch finds code using debugging information emitted by the compiler. Custom attributes (such as TestCaseAttribute) don't emit this information, so there's no way to map them back to the source code.

There are future possibilities though. Roslyn may be a bit of a game changer in this area, so be assured that I will be keeping this in mind :)


Cheers,

Remco
Is it likewise hard to do to show the different test cases as different tests in the NCrunch Tests window? E.g. if I have a test with 5 test cases, I see only 1 test in NCrunch tests and I must re-run/debug all test cases to track down test failure caused by 1 specific test case.

Also currently it is very hard to tell if a test case succeeded or not if test produces a lot of log output. This since the only way to tell them apart is peering through the output log of all test cases.
This was introduced in NCrunch back in v1.36. When you have your Framework utilisation type for NUnit set to 'DynamicAnalysis' (which is the default setting), it will split test cases into separate tests so that they are individually visible and runnable in the Tests Window.

And yes, it was very, very, insanely, hard to do :)

The post at the top of this thread discusses placing markers next to the [TestCase] attribute itself, which is something that isn't really possible with the engine in its current state.
Remco wrote:This was introduced in NCrunch back in v1.36. When you have your Framework utilisation type for NUnit set to 'DynamicAnalysis' (which is the default setting), it will split test cases into separate tests so that they are individually visible and runnable in the Tests Window.
...

Ah thanks, I had apparently set that setting to static a while back ago while hunting for better performance. Will enable it again and re-evaluate performance.

Post a reply

Log in to reply.