【发布时间】:2022-11-21 07:48:15
【问题描述】:
我尝试通过控制台运行测试,但它不起作用。我认为我需要修复测试参数格式。参数值可以有几个字。 你能帮助正确的字符串来运行带参数的测试吗?
我试图更改引号和逗号,但没有帮助。
例子:
dotnet test myProject --filter "Name=MyTest('My parameter value',null)"
错误:
MSBUILD : error MSB1006: Property is not valid.
Switch: null)
For switch syntax, type "MSBuild -help"
我也尝试将逗号编码为 URL 样式,但它也不起作用......
例子:
dotnet test myProject --filter Name=MyTest('My parameter value'%2Cnull)"
错误:
An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Missing Operator '|' or '&'. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.
附言只有当测试有参数时才会出现问题。没有参数,一切正常,如教程和官方文档中所述。
【问题讨论】: