如何使用 SpecFlow C# 实现多个 if else 条件
How to implement multiple if else conditions using SpecFlow C#
我是Specflow.While写特征文件的新手,我在Then部分给定Condition.And中给出了3个布尔语句,我需要根据给定的条件检查结果。
这是一个基本的与门示例:
Input: YES YES YES
Output: YES
Input: YES YES NO
Output: NO
我想你想使用情景大纲。
这是一个例子:
Scenario Outline: AND Gate
Given I have the following input on my AND GATE
| Input 1 | Input 2 | Input 3 |
| <input1> | <input2> | <input3> |
Then I have '<output>' at the output
Examples: | input1 | input2 | input3 | output |
| Yes | Yes | Yes | Yes |
| Yes | Yes | No | No |
<>括号中的内容是参数。
请在此处查看 Gherkin 参考资料:https://cucumber.io/docs/reference#scenario-outline
我是Specflow.While写特征文件的新手,我在Then部分给定Condition.And中给出了3个布尔语句,我需要根据给定的条件检查结果。
这是一个基本的与门示例:
Input: YES YES YES
Output: YES
Input: YES YES NO
Output: NO
我想你想使用情景大纲。
这是一个例子:
Scenario Outline: AND Gate
Given I have the following input on my AND GATE
| Input 1 | Input 2 | Input 3 |
| <input1> | <input2> | <input3> |
Then I have '<output>' at the output
Examples: | input1 | input2 | input3 | output |
| Yes | Yes | Yes | Yes |
| Yes | Yes | No | No |
<>括号中的内容是参数。
请在此处查看 Gherkin 参考资料:https://cucumber.io/docs/reference#scenario-outline