Answer the question
In order to leave comments, you need to log in
Reflections on SpecFlow, BDD?
I'm sitting at work now and trying to write integration tests in SpecFlow under VS2010. The feature is very simple: transferring money from one account to another.
There are many more scenarios: different types of accounts, different types of transfers, different intermediate settings. Each combination, in principle, is a separate scenario.
The question is how to properly break it all into scenarios?
Scenario Outline, judging by the docs, is quite primitive, and I can't specify nested tables
Given I have accounts
|Type|Number|Description|
|<account type>|<account number>|<account description>|
Examples:
|account type|account number|account description|
|checking|23434|my checking|
|savings|11111|my savings|
Answer the question
In order to leave comments, you need to log in
Compose a "state machine" (State pattern) with all the possible states of your system. Traversing in depth all possible states of the automaton will give you a set of all scenarios. Grouping them via Example/Outline is up to you, the main thing is to make it as readable as possible.
And feel free to repeat the same lines. You will implement the steps only once, through annotations. By the way, here we can recall that annotations in SpecFlow support regular expressions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question