使用SpecFlow运行测试时出现以下错误:
System.FormatException: Input string was not in a correct format.
Run Code Online (Sandbox Code Playgroud)
我花了一段时间才弄清楚它为什么会发生.
它最终是因为我在我的一个步骤定义中省略了单引号,例如:
[Then(@"Something adds up to a quantity of (.*)")]
Run Code Online (Sandbox Code Playgroud)
什么时候应该
[Then(@"Something adds up to a quantity of '(.*)'")]
Run Code Online (Sandbox Code Playgroud)
注意(.*)周围的单引号