How to specify custom parameters, using xunit.runner.console How to specify custom parameters, using xunit.runner.console selenium selenium

How to specify custom parameters, using xunit.runner.console


For this solution the extra command-line gives me more flexibility:

"%WORKSPACE%\packages\xunit.runner.console.2.1.0\tools\xunit.console" "%WORKSPACE%[MyProject]\bin\Debug\eDC6.Test.Specs.dll" -TargEnv QAConfig.json - xml test_output.xml


IIRC I asked and self-answered this very question as a feature request in xunit's forums in the codeplex era, pre-2010 but can't locate it atm (perhaps I was asking in the context of CodeRush's test runner). Either way, the above was the answer at that time, and it still makes sense as it's test-runner and CI tool neutral.

This is commonly addressed by environment variables, i.e. use GetEnvironmentVariable.

One thing to consider is that people who want to use runners such as Visual Studio will then need to adjust accordingly. .NET Core has intrinsic support for having an environment selector of this nature, which may also be a useful approach as it's likely to be exposed in editors and other tooling over time.

Finally, the lowest level hack may be to be sticking it into .config settings, i.e., the <DllName>.dll.config and doing the necessary to pass it through there.