【发布时间】:2020-10-20 19:30:08
【问题描述】:
我正在创建一个 SpecFlow 场景(使用 Visualt Studio),其中字母数字文本是语句的一部分。
但是当我创建它的定义时,字母数字文本的数字部分变为参数。例如
Scenario: Add two variables
Given the first number is of type S1 and is 50
And the second number is of type S2 and is 70
When the two numbers of type S1 and S2 are added
Then the result should be 120
当我右键单击 Given 语句并创建定义时,我得到以下定义:
[Given(@"the first number is of type S(.*) and is (.*)")]
public void Function(int p0, int p1)
我想要的是:
[Given(@"the first number is of type S1 and is (.*)")]
public void Function(int p0)
【问题讨论】: