I need to run some code only if I'm running from within the TeamCity test launcher. What's the easiest way to detect this?
I don't see how this is relevant - I'd like to call a method from C# that returns true if I'm running within TeamCity.
ripper234
2009-12-18 09:56:54
You can simply check one of Team City Environment Variables.
Sergey Mirvoda
2009-12-18 10:28:28
as for relevance instead of using TC nunit launcher use can use console launcher with test result publishing and replace your workaround with my one.
Sergey Mirvoda
2009-12-18 10:36:01
+3
A:
Check if TEAMCITY_VERSION environment variable is defined. Another approach is to use NUnit categories.
Eugene Petrenko
2009-12-20 22:48:50