This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Add two numbers | |
Given I have entered 1 into the calculator | |
And I have entered 2 into the calculator | |
When I press add | |
Then the result should be 3 on the screen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Binding] | |
public class CalculatorSteps | |
{ | |
private readonly CalculatorController controller = new CalculatorController(); | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AfterScenario] | |
public void OnError() | |
{ | |
if (ScenarioContext.Current.TestError != null) | |
{ | |
//TODO: save useful information to a file | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BeforeScenario(Order = 10)] | |
public void ResetDatabase() | |
{ | |
myDatabase.ResetToBaseline(); | |
} | |
[BeforeScenario("login", Order = 20)] | |
public void LoginAUser() | |
{ | |
loginPage.GoTo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Addition | |
Scenario Outline: Add two numbers | |
Given I have entered <a> into the calculator | |
And I have entered <b> into the calculator | |
When I press add | |
Then the result should be <result> on the screen | |
Examples: | |
| case | a | b | result | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sets the step argument conversion infrasuructure as default for CreateSet and CreateInstance | |
/// </summary> | |
/// <remarks> | |
/// This method has to be called once, in a static ctor for example. Note: this way of setting is not | |
/// supported for parallel execution. | |
/// </remarks> | |
private static void SetupStepArgumentConverterValueRetriever() | |
{ | |
var assistService = TechTalk.SpecFlow.Assist.Service.Instance; |