2
votes

When i generate a step definition with And/But attribute it takes the previous steps attribute(Given/When/Then). I feel the implementation in cucumber is better as we can use And/But as it is and its more aligned with bdd.

Why there is no separate 'And'/ 'But' Attribute, is there a significant reason not using in Specflow?

1
I'm voting to close this question as off-topic because its not about a programming issue but a design decision, and this is not the place to ask that sort of stuff - Sam Holder

1 Answers

1
votes

Conceptually And and But are just syntactic sugar for the actual step type of Given When or Then. All steps are really of one of those types. In the specflow implementation it would be possible to have different implementations for And steps which were after a Given and those after a When, where as in a language where And is a native step type this wouldn't be possible. Conversely you have to attribute an And step with two attributes to use it both after a Given and a When.

This might be a good thing or might be a bad thing. In the end I think this is just an implementation decision which is swings and roundabouts, and make little difference.