c# - BDD SpecFlow 场景

标签 c# .net testing bdd specflow

今天我开始使用 SpecFlow + Selenium 研究 BDD,我发现了几个只显示 1 个返回的例子。

如何编写返回多个项目的场景。例如:

Given a name "test"
I click on the SEARCH button

那么结果将等于下表:

name | last name
test | fulano
test | siclano

在这种情况下,我该如何编写 THEN?接受返回表中显示的 2 行?

最佳答案

场景:

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
}

关于c# - BDD SpecFlow 场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39517559/

相关文章:

ruby - 在 Ruby 测试中验证大哈希的有效方法

c# - 什么影响 C# PNG 无损压缩率?

testing - 租赁虚拟机进行负载测试

c# - 使用 C# 和 Linq 创建一个包含来自两个输入数组的唯一项的数组

c# - 每个方法有不同的 appender

.net - C++ 'GET' 请求或如何下载文件以在 C++ 中使用?

.net - 为什么找不到我的自定义 WCF 行为扩展元素类型?

android - Robolectric 2.1 和 Eclipse

c# - 当我尝试使用 Cake 构建我的项目时出现错误

c# - 尝试连接时,Azure Vault 中的 GetSecret 抛出 NullReferenceException