R
R
rroyter2011-05-11 00:53:53
.NET
rroyter, 2011-05-11 00:53:53

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|

Then what about the rest of the settings. For example, you can enable transfer confirmation, or you can not include it. That is, I need to run all the scripts twice. You can add one more parameter to the Scenario Outline, but then you get a completely awkward matrix.
In general, I will be very grateful to those who solved such issues.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marshinov, 2013-02-18
@marshinov

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 question

Ask a Question

731 491 924 answers to any question