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

Notification

Icon
Error

NCrunch Execution Flags
mikeedwards83
#1 Posted : 12 years ago
Rank: Newbie

Groups: Registered
Joined: 12/2/2011(UTC)
Posts: 8

I have some code that I want to run when using the NUnit standalone runner but should not be run when testing using NCrunch. I need to test if NCrunch is running but I don't want to include the NCrunch DLLs as part of the project.

Does NCrunch set any flags that could be accessed without referencing the NCrunch assembly, for example setting a value in the System.Threading.Thread.CurrentThread.ExecutionContext?
Remco
#2 Posted : 12 years ago
Rank: NCrunch Developer

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

Thanks: 977 times
Was thanked: 1314 time(s) in 1219 post(s)
There are several ways you can handle this. Generally I would recommend the '#if NCRUNCH' override in this situation.
mikeedwards83
#3 Posted : 12 years ago
Rank: Newbie

Groups: Registered
Joined: 12/2/2011(UTC)
Posts: 8

Excellent, thanks for the quick reply.
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.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download