If i run my unit tests using NUnit's nunit3-console CLI utility I'm able to pass parameters using the "params" flag like so:
>nunit3-console --params:testKey=test203 TestClass.dll
Debugging in VS is really annoying because I have to set the flag "--debug", i then have to attach to the process from visual studio. My question is whether it's possible to somehow pass in that same parameter to my unit tests using only visual studio?
The reason I need to pass in params this way is because I need it in my setup methods and Nunit does not allow me to dynamically change it using a variable.
You specify the run parameters in your .runsettings
file. Here's what an example file with no other settings would look like...
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<TestRunParameters>
<Parameter name="webAppUrl" value="http://localhost" />
<Parameter name="webAppUserName" value="Admin" />
<Parameter name="webAppPassword" value="Password" />
</TestRunParameters>
</RunSettings>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With