【发布时间】:2019-02-04 16:17:00
【问题描述】:
我正在使用 specflow,并且在我的示例中有一个相当大的表:
它有大约 14 个字段。
有没有更好的方法将所有这些字段传递到 item1 和 item2 和 item4 的方法中
我可以看到有一个create set方法,但这似乎不适合示例,并且仅在步骤中......以及步骤。
有没有办法在对象中传递数据而不是发送 14 个字符串?
希望这是有道理的。
塔,
史蒂夫
** 编辑 ** 添加示例
这是我的示例文件的标题
| propLocation | locPropToBuy | propertyType | newBuild | appsLiveProprty | ownershipType | purchPrice | totLoanAmount | intOnlyAmount | prefLoanTermYrs | prefLoanTermMths |
为此生成的方法如下所示:
[When(@"the user provides input for the Property and Loan Requirements Section (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*) and (.*)")]
public void WhenTheUserProvidesInputForThePropertyAndLoanRequirementsSectionEnglandAndYesAndTerracedHouseAndYesAndYesAndStandardAndAndAndAndAndAndAndAndSAnd(string propLocation,
string locPropToBuy, string propertyType, string newBuild, string legalOwnership,
string ownershipType, string equityShreScheme, string purchPrice, string fullMarketVal,
string termShareLoanYrs, string termShareLoanMths, string totLoanAmount,
string intOnlyAmount, string prefLoanTermYrs, string prefLoanTermMths)
虽然我最终会将编码值更改为 (.*) 等。
如果我可以只传递一个对象或所有值的列表而不是长字符串实例,那对我来说会更容易。
【问题讨论】:
-
能否提供您的步骤、表格、示例和绑定的示例?我不确定你是什么意思。谢谢!
-
我已经更新了一点。这有意义吗?
标签: specflow