Is it somehow possible to pass values to NUnit tests via the command line?
My tests use a certain URL. I have different instances of my code at different URLs and would like to specify the URL via the command line. File App.config
is not an option, because I want to run the tests for different URLs via a batch file.
In Visual Studio, from the Tools menu, select NuGet Package Manager | Manage NuGet packages for solution... Open the Browser tab, and Scroll or use search to locate the NUnit and NUnit. Console packages.
Use an environment variable to pass the information.
Use set
from the command-line or <setenv>
from NAnt. Then read the value using Environment.GetEnvironmentVariable()
.
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