Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Pending tests for NotImplementedException
GraemeF
#1 Posted : Thursday, September 1, 2011 9:24:48 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/14/2011(UTC)
Posts: 12
Location: UK

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
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 ;)
Remco
#2 Posted : Friday, September 2, 2011 12:17:28 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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?
GraemeF
#3 Posted : Friday, September 2, 2011 12:29:16 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/14/2011(UTC)
Posts: 12
Location: UK

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
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.
Remco
#4 Posted : Friday, September 2, 2011 6:27:35 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
TheCodeJunkie
#5 Posted : Saturday, September 3, 2011 6:59:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/11/2011(UTC)
Posts: 6
Location: Sweden

Was thanked: 1 time(s) in 1 post(s)
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
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download