问题
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