在f#中而不是c#中生成specflow stepdefinitions骨架 [英] Generating specflow stepdefinitions skeleton in f# instead of c#

查看:43
本文介绍了在f#中而不是c#中生成specflow stepdefinitions骨架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图使用specflow中的上下文菜单"Generate Step Definitions"来生成f#步骤定义框架文件.但是它仅生成c#.有没有一种方法可以告诉用户步骤定义的首选语言.我们已经使用F#编写了大多数验收测试.任何建议表示赞赏

I have been trying to generate f# step definition skeleton file using context menu "Generate Step Definitions" in specflow. But it generates only c#. Is there a way that we tell user preferred language for step definitions. We have most of our acceptance tests written in F# already. Any suggestions are appreciated

推荐答案

Specflow 有一些支持 for F#,似乎您有一个模板,可以在不将其复制到剪贴板时生成定义(请参见从功能文件(带有自定义模板)中生成步骤定义框架a href ="http://www.specflow.org/whatsnew-19/" rel ="nofollow">此页面).

Specflow has some support for F# and it seems that you have a template for generating the definitions when you don't copy them to the clipboard (see Generate step definition skeletons from feature files (with custom templates) on this page).

根据此页面,似乎还支持F#stepdefinitions. github上的本页显示F#包含在默认模板.

It also seems that F# stepdefinitions are supported according to this page and this page on github shows that F# is included in the default templates.

希望其中一些链接将指导您如何使用spec#将F#用于步骤

Hopefully some of those links will guide you towards how you get specflow to use F# for the steps

再考虑一下这一点,我本以为您可以通过编辑DefaultSkeletonTemplates.sftemplate文件并用f#替换c#模板来生成f#模板来对此进行破解.几乎可以肯定这是一个坏主意-不要这样做.但这可能有用

Having thought about this a little more I would have thought you could hack this by editing the DefaultSkeletonTemplates.sftemplate file and replacing the c# template with the f# one to generate the f# templates. This is almost certainly a Bad Idea - don't do it. But it might work

这篇关于在f#中而不是c#中生成specflow stepdefinitions骨架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆