The BDD Methods and the Step Methods

A method inside a BDD Component can be an ordinary C# method or a BDD Method: the BDD Methods are those that have declared an attribute Given/When/Then or, at least a GenericBDDMethod attribute. If a method does not have these attributes is a generic C# method. It can be invoked by a BDD method, but it cannot be managed directly by the BDD Extension Framework.

The methods that have declared a Given/When/Then attribute can be used as a main part of the Given/When/Then scenario. Inside the attribute, there is a mandatory string parameter that has to contain the descriptive sentence of that part of the BDD Scenario. When a Given/When/Then method is chosen for being a part of the scenario, it is called Step Method.

The methods that have declared a GenericBDDMethod attribute cannot be used as Step Method. However, they can become an "invisible" part of a scenario if they are set to be invoked before a Step Method, usually as a prerequisite, by the declaration of another attribute on the Step Method: the CallBefore attribute.

 

There are two ways to choose which BDD Methods have to take part of the scenario: whichever is the way, they have to be contained in a Static BDD Component or a Dynamic BDD Component.

 

Back to: BDD Extension Framework Read next: BDD Components: Static or Dynamic

 

© 2017 Hud Dimension. All Rights Reserved.

Search