Generating specflow stepdefinitions skeleton in f# instead of c#

怎甘沉沦 提交于 2019-12-25 02:26:22

问题


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


回答1:


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).

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.

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

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



来源:https://stackoverflow.com/questions/24673044/generating-specflow-stepdefinitions-skeleton-in-f-instead-of-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!