-
Notifications
You must be signed in to change notification settings - Fork 6
Tables
msuarz edited this page Nov 2, 2010
·
2 revisions
Mostly used in Setup and Verify steps. The default behavior results in bi-dimensional array passed into the step. The types are inferred.
<pre> Scenario: Dead cell with 0 neighbors stays dead Given the following setup
. | . | . |
. | . | . |
. | . | . |
When I evolve the board Then the center cell should be “dead” </pre>
[TestMethod]
public void DeadCellWith0NeighborsStaysDead()
{
Given_the_following_setup
(
new[] {".", ".", "."},
new[] {".", ".", "."},
new[] {".", ".", "."}
);
When_I_evolve_the_board();
Then_the_center_cell_should_be("dead");
}
public void Given_the_following_setup(params string[][] Cells)
{
...
}
Use **[** and **]** on the first row to make it a header. Instead of an array
<pre> Scenario: Sum A plus B = C [A |B |C ]
0 | 0 | 0 |
0 | 1 | 1 |
21 | 21 | 42 |
</pre>