Configuration option "Test Parameter" in NUnit section is not documented and seem to have no effect



I wanted to pass parameters to our NUnit tests and have found a list in the options where Name/Value-Pairs can be configured and the title is "Test Parameters". But I cannot find where those parameters can be retrieved in my test. I tried EnvironmentVariables and the TestContext. Also in the execution log I do not find those parameters. Also this list is not mentioned in the online help.

How can I use these parameters?

Vresions: Visual Studio Enterprise 2017 (15.9.16), R# Ultimate 2019.2.2, NUnit 3.11.0, TargetPlatform x64, TargetFramework .NET 4.8

Best Regards,

Comment actions Permalink

Hello Peter,


This Test Parameters list is dictionary<string, string>. 

When the list is set, its values will be available in test using NUnit.Framework.TestContext.Parameters.

They are merged with TestParameters in runsettings file which can be configured in VS.

Thank you for pointing out the missing part in the online help, we'll update it shortly.

Comment actions Permalink

Thank you very much. Didn't found this global parameters in the TestContext, this was the missing part. Now it works as expected.





Please sign in to leave a comment.