Created
May 24, 2016 05:03
BDDfy examples feature usage
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
public class ExamplesUsage | |
{ | |
private Int32 _initial; | |
private Int32 _eat; | |
[Given("Given there are <initial> cucumbers")] | |
private void Given(Int32 initial) | |
{ | |
_initial = initial; | |
} | |
[Given("When I eat <eat> of them")] | |
private void When(Int32 eat) | |
{ | |
_eat = eat; | |
} | |
[Then("When I should have <left> left")] | |
private void Then(Int32 left) | |
{ | |
(_initial - _eat).ShouldBe(left); | |
} | |
[TestCase] | |
public void Execute() | |
{ | |
this.WithExamples( | |
new ExampleTable("initial", "eat", "left") | |
{ | |
{12, 5, 7}, | |
{20, 5, 15} | |
}).BDDfy(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment