【问题标题】:BDD SpecFlow ScenariosBDD SpecFlow 场景
【发布时间】:2016-09-16 16:08:03
【问题描述】:
今天我开始使用 SpecFlow + Selenium 研究 BDD,我发现了几个仅显示 1 返回的示例。
如何编写返回多个项目的场景。例如:
Given a name "test"
I click on the SEARCH button
那么结果将等于下表:
name | last name
test | fulano
test | siclano
在这种情况下,我该如何写 THEN?,接受返回显示的表的 2 行?
【问题讨论】:
标签:
c#
.net
testing
bdd
specflow
【解决方案1】:
场景:
Given a name "test"
When I click on the SEARCH button
Then the result will be
| name | last name
| test | fulano
| test | siclano
代码:
[Then("The result will be")]
public void ThenTheResultWillBe(Table table)
{
//check that the result contains all the values in the table
}