Pierre
Pierre

Reputation: 595

SpecFlow, using NUnit attribute 'pairwise'

I might have totally misunderstood some fundamental things about SpecFlow, but I would like to have a data table and make use of NUnit attribute 'pairwise' to run my tests.

Using example on NUnit wiki on Pairwise attribute I would like to be able to write something like:

Scenario: Pairwise test...
Given I have the following values to calculate:
|value1|sign|value2|
|a     |+   |x     |
|b     |-   |y     |
|c     |    |      |

And this should result in 6 test runs as seen on NUnit page. Maybe this should be a scenario outline and put in examples instead.

But my questions is if its possible to use nunit attribute pairwise (or similar) and if so; how to do it?

Upvotes: 1

Views: 287

Answers (1)

Andreas Willich
Andreas Willich

Reputation: 5825

First: There is no support of the Pairwise attribute in SpecFlow. You have to create each possible combination by your self and fill up the example table.

Second: You have in your example a Scenario. This will be one test. What you want is a Scenario Outline with an Example table. Look here for information about it: http://specflow.org/documentation/Using-Gherkin-Language-in-SpecFlow/


Full disclosure: I am one of the SpecFlow developers.

Upvotes: 2

Related Questions