-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #271 This PR modifies the Feature AST visitor to appropriatel…
…y handle Rule Background steps. (#272)
- Loading branch information
1 parent
03ecd34
commit 44078a1
Showing
5 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
17 changes: 17 additions & 0 deletions
17
...ata.ReqnrollPlugin.IntegrationTest/Features/ExternalDataWithRuleBackgroundFromCSV.feature
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: ExternalDataWithRuleBackgroundFromCSV | ||
|
||
This feature demonstrates that Rule Background steps are handled appropriately when using the External Data Plugin. | ||
This test validates a regression. | ||
|
||
Rule: Steps in Background are properly executed | ||
Background: | ||
Given my favorite color is blue | ||
@DataSource:products.csv | ||
Scenario: The basket price is calculated correctly | ||
The scenario will be treated as a scenario outline with the examples from the CSV file. | ||
The CSV file contains multile fields, including product and price. | ||
Given the price of <product> is €<price> | ||
And the customer has put 1 pcs of <product> to the basket | ||
When the basket price is calculated | ||
Then the basket price should be €<price> | ||
And the color given as my favorite was blue |
28 changes: 28 additions & 0 deletions
28
...ExternalData.ReqnrollPlugin.IntegrationTest/StepDefinitions/BackgroundStepsDefinitions.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using NUnit.Framework; | ||
using Reqnroll; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace XReqnroll.ExternalData.ReqnrollPlugin.IntegrationTest.StepDefinitions | ||
{ | ||
[Binding] | ||
internal class BackgroundStepsDefinitions | ||
{ | ||
[Given("my favorite color is {word}")] | ||
public void GivenMyFavoriteColorIs(string color) | ||
{ | ||
_color = color; | ||
} | ||
|
||
private string _color; | ||
|
||
[Then("the color given as my favorite was {word}")] | ||
public void ThenTheColorGivenAsMyFavoriteWas(string color) | ||
{ | ||
Assert.That(_color, Is.EqualTo(color)); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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