替换Specflow中的小黄瓜

时间:2012-06-26 08:53:08

标签: asp.net-mvc-3 specflow gherkin

我们刚刚决定在.Net MVC项目中使用Specflow。

我们有什么方法可以用任何替代语言取代目前使用的语言,即Gherkin?有没有其他选择?

干杯,

哈桑

2 个答案:

答案 0 :(得分:3)

如果您的“替代语言”的含义是本地化(即翻译“给定”,“何时”,“那么”,“为了”......对德语“Angenommen”,“Wenn” “,”Dann“,....)你可以在配置文件

中完成
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/>
  </configSections>
  <specFlow>
    <language feature="de-DE" tool="" />
  </specFlow>
</configuration>

有关详细信息,请参阅Make SpecFlow / Cuke4VS understand non-English .feature files

答案 1 :(得分:1)

我不相信在specflow中使用替代语言是可能的。

我不确定为什么要替换Gherkin,我发现通过使用Gherkin,业务已经能够为创建和运行的测试用例提供有价值的输入,这是由于Gherkin语言非常人性化。