C# 使用示例的SpecFlow参数绑定

C# 使用示例的SpecFlow参数绑定,c#,.net,specflow,gherkin,C#,.net,Specflow,Gherkin,我的SpecFlow功能文件中有以下内容 Scenario: Signout Given I am signed in with an <userAccountType> account When I sign out Then I should see the signin page Examples: | userAccountType | | AAD | | MSA | 运行时,我

我的SpecFlow
功能文件中有以下内容

Scenario: Signout
    Given I am signed in with an <userAccountType> account
    When I sign out
    Then I should see the signin page
Examples:
    | userAccountType |
    | AAD             |
    | MSA             |

运行时,我将字符串
传递到方法中的参数中,而不是
AAD
MSA

模板仅在场景大纲中受支持,而不在场景中受支持。将
场景:
更改为
场景大纲:
(您可能还需要修复
示例的缩进)。@jeroenmoster这确实是答案。模板仅在场景大纲中受支持,而不在场景中受支持。将
场景:
更改为
场景大纲:
(您可能还需要修复
示例的缩进)。@jeroenmoster这确实是答案。
[Given(@"I am signed in with an (.*) account")]
public async Task GivenIAmSignedInWithAnAccount(string userAccountType)
{
    // ...
}