目前更PARAMS我们有这一步:specflow: - “找到的一步暧昧的步骤定义”时,1级比其他
[When(@"I set the scenario price for product (.*) to (.*)")]
public void WhenISetTheScenarioPriceForProductPToN(string product, string priceStr)
我要补充步骤:
[When(@"I set the scenario price for product (.*) to (.*) in the (.*) zone")
public void WhenISetTheScenarioPriceInZoneForProductPToN(string product, string priceStr, string zone)
然而规格流给出两个步骤之间的误差的“找到的步骤歧义步骤定义”。
我已经厌倦了:
[When(@"I set the scenario price for product (.*) to (.*) in the (.*) zone")]
[When(@"I set the scenario price for product (.*) to (.*)")]
public void WhenISetTheScenarioPriceInZoneForProductPToN(string product, string priceStr, string zone)
但失败,出现“绑定错误:参数数量不匹配”我希望它会在第二个“什么时候”通过。
我不能用测试中的类似步骤重现模糊步骤问题,但参数计数不匹配是因为每个正则表达式模式代码都会为方法生成一个参数。它似乎也不支持默认参数值。 –
@Admin,这听起来像一个specflow中的bug,因为我不明白为什么“when”和“given”以不同的方式进行匹配。 –