Skip to content

Instantly share code, notes, and snippets.

@gasparnagy
Last active February 9, 2016 21:57
Show Gist options
  • Save gasparnagy/15397cbf5f8b4fa805aa to your computer and use it in GitHub Desktop.
Save gasparnagy/15397cbf5f8b4fa805aa to your computer and use it in GitHub Desktop.
Examples for blog post "SpecFlow tips: Feature file backgrounds -- like them or not"
Feature: Shopping Cart
Scenario: Books can be added to the cart
Given the following books
| Author | Title | Price |
| Martin Fowler | Analysis Patterns | 50.20 |
| Eric Evans | Domain Driven Design | 46.34 |
| Ted Pattison | Inside Windows SharePoint Services | 31.49 |
| Gojko Adzic | Bridging the Communication Gap | 24.75 |
And I am logged in
When I place "Analysis Patterns" into the cart
Then my cart should contain 1 piece of "Analysis Patterns"
Scenario: Books can be removed from the cart
Given the following books
| Author | Title | Price |
| Martin Fowler | Analysis Patterns | 50.20 |
| Eric Evans | Domain Driven Design | 46.34 |
| Ted Pattison | Inside Windows SharePoint Services | 31.49 |
| Gojko Adzic | Bridging the Communication Gap | 24.75 |
And I am logged in
And I have a cart with "Analysis Patterns"
When I delete "Analysis Patterns" from the cart
Then my cart should be empty
Feature: Shopping Cart
Background:
Given the following books
| Author | Title | Price |
| Martin Fowler | Analysis Patterns | 50.20 |
| Eric Evans | Domain Driven Design | 46.34 |
| Ted Pattison | Inside Windows SharePoint Services | 31.49 |
| Gojko Adzic | Bridging the Communication Gap | 24.75 |
And I am logged in
Scenario: Books can be added to the cart
When I place "Analysis Patterns" into the cart
Then my cart should contain 1 piece of "Analysis Patterns"
Scenario: Books can be removed from the cart
Given I have a cart with "Analysis Patterns"
When I delete "Analysis Patterns" from the cart
Then my cart should be empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment