You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MorganPersson edited this page Nov 26, 2012
·
1 revision
You can let nbehave instantiate types for you so you dont have to implement your steps with only primitive data types.
The type parameter the step takes must have a default public constructor and the parameters from the text step must be public properties.
Given this step implementation:
[Given("a book with title $title and isbn $isbn")]publicvoidStepImpl(stringtitle,stringisbn){}
You could implement the step with the following code:
[Given("a book with title $title and isbn $isbn")]publicvoidStepImpl(Bookbook){}publicclassBook{publicstringTitle{get;set;}publicstringIsbn{get;set;}}
This works for lists too.
Example:
Given some books:
| title | isbn | | aaaaa | 1111 | | bbbbb | 2222 |