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

Notification

Icon
Error

NCrunch Execution Flags
mikeedwards83
#1 Posted : Monday, January 14, 2013 10:12:00 PM(UTC)
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 : Monday, January 14, 2013 10:32:17 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
There are several ways you can handle this. Generally I would recommend the '#if NCRUNCH' override in this situation.
mikeedwards83
#3 Posted : Monday, January 14, 2013 10:50:34 PM(UTC)
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.023 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download