Feature Suggestions

Pending tests for NotImplementedException

Started by GraemeF on 10,339 views

It'd be nice if tests that throw a NotImplementedException could be shown as Pending rather than Failed. It would make me feel better about it, anyway ;)
This is an interesting suggestion. I think the complexity here would be in differentiating between a test that was deliberately throwing a NotImplementedException and a test that was throwing a NotImplementedException by calling into actual production code that is expected to be working :)

I'd like to read a bit more into your intention. Is it that you're writing incomplete test stubs and wanting to have these stubs tracked by NCrunch, but not necessarily executed?
No, my normal TDD workflow is to write a test then I use ReSharper to generate any new methods, and in their bodies it throws a NotImplementedException.

Some test runners (e.g. ReSharper) treat a test that throws one of those as inconclusive, and it shows up yellow rather than red. So, I can keep an eye on the tests as I work and fix any reds, and when there are none left I know its time to do the next yellow. Would be really nice to get this same feedback with NCrunch.

The tests are run (so aren't ignored or anything), it's merely the exception that was thrown that flags it as inconclusive.

Edited

This makes sense. NCrunch doesn't currently have an 'inconclusive' status, but it needs one for a number of reasons. I don't see why tests can't be marked as inconclusive on a NotImplementedException - provided other test runners have already set the standard that is :)

On the list it goes.
I would argue that if you have production code that throws NotImplementedException that you are doing things wrong. If you have, say members of an interface or an abstract class, that you do not provide an implementation for then you should instead be throwing NotSupportedException

Post a reply

Log in to reply.