Skip to content

Commit

Permalink
Added string.Format scenario handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gubpalma committed Apr 7, 2024
1 parent 5cf9e91 commit 95e3327
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ You can find some additional SpecFlow markdown documentation [here](https://docs

Scenario: Various request scenarios
Given a request has been created
And the first name is set to <first_name> with <unused_variable> not being used
And the first name is set to <first_name> with neither <unused_variable_1> nor <unused_variable_2> being used
And the last name is set to <last_name>
And the tickets requested are set to <number_of_tickets>
When the validation request is made
Then the validation request should succeed
And there should be no error message

Examples:
| first_name | last_name | number_of_tickets | unused_variable |
| John | Smith | 10 | 12 |
| Paul | Jones | 15 | 13 |
| Mary | Sue | 1 | 14 |
| Alex | McCain | 1 | 15 |
| Mary | Jones | 100 | 43 |
| The | Emperor | 1 | 42 |
| Cole | Stevens | 42 | 41 |
| Jack | Smith | 5 | 40 |
| first_name | last_name | number_of_tickets | unused_variable_1 | unused_variable_2 |
| John | Smith | 10 | 12 | 1 |
| Paul | Jones | 15 | 13 | 1 |
| Mary | Sue | 1 | 14 | 1 |
| Alex | McCain | 1 | 15 | 1 |
| Mary | Jones | 100 | 43 | 1 |
| The | Emperor | 1 | 42 | 1 |
| Cole | Stevens | 42 | 41 | 1 |
| Jack | Smith | 5 | 40 | 1 |

@tickets
Scenario: An inconclusive test
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void ThenThereShouldBeNoErrorMessage()
.Null(_response.Message);
}

[Given(@"the first name is set to (.*) with (.*) not being used")]
public void GivenTheFirstNameIsSetTo(string value, string unused) => _request.FirstName = value;
[Given(@"the first name is set to (.*) with neither (.*) nor (.*) being used")]
public void GivenTheFirstNameIsSetTo(string value, string unused_1, string unused_2) => _request.FirstName = value;

[Given(@"the last name is set to (.*)")]
public void GivenTheLastNameIsSetTo(string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ You can find some additional SpecFlow markdown documentation [here](https://docs

Scenario: Various request scenarios
Given a request has been created
And the first name is set to <first_name> with <unused_variable> not being used
And the first name is set to <first_name> with neither <unused_variable_1> nor <unused_variable_2> being used
And the last name is set to <last_name>
And the tickets requested are set to <number_of_tickets>
When the validation request is made
Then the validation request should succeed
And there should be no error message

Examples:
| first_name | last_name | number_of_tickets | unused_variable |
| John | Smith | 10 | 12 |
| Paul | Jones | 15 | 13 |
| Mary | Sue | 1 | 14 |
| Alex | McCain | 1 | 15 |
| Mary | Jones | 100 | 43 |
| The | Emperor | 1 | 42 |
| Cole | Stevens | 42 | 41 |
| Jack | Smith | 5 | 40 |
| first_name | last_name | number_of_tickets | unused_variable_1 | unused_variable_2 |
| John | Smith | 10 | 12 | 1 |
| Paul | Jones | 15 | 13 | 1 |
| Mary | Sue | 1 | 14 | 1 |
| Alex | McCain | 1 | 15 | 1 |
| Mary | Jones | 100 | 43 | 1 |
| The | Emperor | 1 | 42 | 1 |
| Cole | Stevens | 42 | 41 | 1 |
| Jack | Smith | 5 | 40 | 1 |

@tickets
Scenario: An inconclusive test
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void ThenThereShouldBeNoErrorMessage()
.Null(_response.Message);
}

[Given(@"the first name is set to (.*) with (.*) not being used")]
public void GivenTheFirstNameIsSetTo(string value, string unused) => _request.FirstName = value;
[Given(@"the first name is set to (.*) with neither (.*) nor (.*) being used")]
public void GivenTheFirstNameIsSetTo(string value, string unused_1, string unused_2) => _request.FirstName = value;

[Given(@"the last name is set to (.*)")]
public void GivenTheLastNameIsSetTo(string value)
Expand Down

0 comments on commit 95e3327

Please sign in to comment.