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

Notification

Icon
Error

EnumerateTestCommands
antix
#1 Posted : Wednesday, September 19, 2012 12:35:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/14/2012(UTC)
Posts: 5

Thanks: 2 times
Hello

I am trying to get a test to skip based on a check made in EnumerateTestCommands

e.g.

Code:
 if (someCriteria)
{
                return new[] { new SkipCommand(method, method.Name, "Integration test skipped") };
}


but this is resulting in a failed test

> *** Warnings ***

> The test was skipped. Reason: Integration test skipped

Ideally it would result in the same thing as adding Skip to the attribute declaration (which I can't do in this case)

Code:
[Fact(Skip = "Integration test skipped")]


Ant
antix
#2 Posted : Wednesday, September 19, 2012 2:10:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/14/2012(UTC)
Posts: 5

Thanks: 2 times
ok, looks like an xunit thing rather than anything to do ncrunch, the method is too late
Remco
#3 Posted : Wednesday, September 19, 2012 10:58:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,979

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
There is an inconsistency here with the way that NCrunch handles situations like this vs other test runners.

For reasons of simplicity, NCrunch doesn't have an 'inconclusive' state for tests that have been executed. This means that should a test report an inconclusive result at runtime (such as the one you've described above), NCrunch will still consider the test as having a pass/fail result as it has no way to represent the different response from the test.

There is a project-level configuration option you can use to control how NCrunch should respond to an inconclusive result, it's called 'Consider inconclusive tests as passing'. This may or may not be of some use to you.


Cheers,

Remco
antix
#4 Posted : Thursday, September 20, 2012 1:39:54 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/14/2012(UTC)
Posts: 5

Thanks: 2 times
Yes that option gets those tests out of my list which is what I want

Thanks for the explanation, Ant
Users browsing this topic
Guest (2)
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.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download