我在使用 SpecFlow 运行测试时遇到以下错误:
System.FormatException: Input string was not in a correct format.
我花了一段时间才弄明白为什么会这样。
最佳答案
它最终是因为我在我的步骤定义之一中省略了单引号,例如:
[Then(@"Something adds up to a quantity of (.*)")]
应该是什么时候
[Then(@"Something adds up to a quantity of '(.*)'")]
注意 (.*) 周围的单引号
关于c# - SpecFlow:System.FormatException:输入字符串的格式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29393717/