-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Char '&' not supported in test parameters in Nunit 3.7.0 #331
Comments
This is a command line problem, rather than Nunit I’d guess. Have you tried escaping the ampersand, as below? |
Thanks Chris, that worked great! I still need to remove the Regarding .runsettings (or .testsettings,....), is there any reason for not being supported by nunit-console? Thanks for your help! |
@jocasofer NUnit-console came first, of course, and as a command-line program relied on arguments to specify parameters and options. The VS adapter didn't have any way to enter arguments but Microsoft provided the option of a There's no technical reason that file couldn't be supported by the console with a command-line option that pointed to the file. However, that would result in having many different ways to specify options. Currently, we support direct entry of options, the |
That shouldn't be necessary - by the time it gets through to your C#, the parameter should just read What are you actually passing? 🙂 |
@ChrisMaddock You're right! I had some quote characters in the parameters that shouldn't be there. I removed them and it's working perfectly. @CharliePoole I understand your point of view. But my question originated from my need of having 2 parameters files. A XML runsettings file for VS and a batch with |
@jocasofer I see your point, particularly for users (unlike me 😄 ) who consider VS as their primary environment for running tests. There would be some details to work out about how to represent settings that are available by design in the console but not in the adapter. Conversely, if such settings were placed in the Essentially, it seems to me that CI will almost invariably require some other set of parameters from test runs performed by developers on their own machines. I agree it could be worth exploring though. |
Hi,
If I run a test with this commandline, all parameters after '&' are disregarded:
nunit3-console test.dll --params=Parameter1Name=Paramet&er1Value;Parameter2Name=Parameter2Value
In TestResult.xml, they show up like this:
I also tried to escape the '&' but with no luck.
Is there any other way to use parameters with '&'?
Just another thought, why not use the runsettings file to pass the parameters to nunit-console?
Because I can run my tests from VS, with parameters containing '&'.
(In this case,
'&'
needs to be converted to'&'
)Thanks
Jose
The text was updated successfully, but these errors were encountered: