How can I reuse steps? - adamralph/xbehave.net GitHub Wiki

A useful way of reusing initial steps for many scenarios is to use Backgrounds.

However, when common steps need to take place after differing initial steps, or when only some scenarios in a class have common initial steps, background steps cannot be used and we need other strategies.

In all cases, it usually a good idea to encapsulate any heavy lifting in your steps in an internal DSL quite early so that most of your steps are left as one liners (see the code examples in http://adamralph.com/2012/07/28/new-background-attribute-in-xbehave-net-0-12-0/, Full example). This reduces the burden of repetition greatly and can often result in the best solution being to just repeat the steps.

The world of C#/{insert favourite .NET language here} is your oyster!