Specflow step argument transformation on table cell contents with CreateInstance

前端 未结 2 1148
醉梦人生
醉梦人生 2021-01-19 14:48

Has anyone solved the riddle of how to apply SpecFlow Step Argument Transformations to cells in a table, in conjunction with the SpecFlow.Assist CreateInstance/CreateSet? (

相关标签:
2条回答
  • 2021-01-19 15:27

    I don't think what you want is implemented currently, but theoretically I think it could be implemented. You can probably implement a new, enhanced DateTimeValueRetriever yourself which checks to see if the string is parseable as a datetime first and if not checks if any of the [StepArgumentTransformation] methods can parse it, and then replace the current DateTimeValueRetriever with your enhanced one. Then you could submit a pr offering your new version as an enhancement to the existing version, and see what the appetite is.

    0 讨论(0)
  • 2021-01-19 15:46

    I have created a small prototype that can be used to reconfigure Assist to be able to pick up conversions with [StepArgumentTransformation] bindings.

    My plan is to make a blog post about it, but until it is ready, maybe you can get out the essence from this gist. (I did it a year ago for SpecFlow v2.0, so some smaller adaptions might be necessary.)

    https://gist.github.com/gasparnagy/a478e5b7ccb8f557a6dc

    0 讨论(0)
提交回复
热议问题