Skip to content

Instantly share code, notes, and snippets.

@gasparnagy
Created February 20, 2017 09:56
Show Gist options
  • Save gasparnagy/e965c3b862494f82a89565aae8cc5730 to your computer and use it in GitHub Desktop.
Save gasparnagy/e965c3b862494f82a89565aae8cc5730 to your computer and use it in GitHub Desktop.
Scenario: Parameterless steps
Given a scenario 'Simple Scenario' as
"""
When I do something
"""
And the following step definitions
"""
[When]
public void When_I_do_something()
{}
"""
When I execute the tests
Then the binding method 'When_I_do_something' is executed
Scenario Outline: Steps with parameters
Given a scenario 'Simple Scenario' as
"""
When <parameter> does something
"""
And the following step definitions
"""
[When]
public void When_WHO_does_something(string who)
{
if (who != "Joe") throw new Exception("invalid parameter: " + who);
}
"""
When I execute the tests
Then the binding method 'When_WHO_does_something' is executed
And the scenario should pass
Examples:
| case | parameter |
| simple | Joe |
| quoted | "Joe" |
| apostrophed | 'Joe' |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment