Created
April 1, 2014 15:50
-
-
Save JakeGinnivan/9916947 to your computer and use it in GitHub Desktop.
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 ReflectiveExamples | |
{ | |
public int Start { get; set; } | |
public int Eat { get; set; } | |
public int Left { get; set; } | |
//Scenario Outline: eating | |
// Given there are <start> cucumbers | |
// When I eat <eat> cucumbers | |
// Then I should have <left> cucumbers | |
public void GivenThereAre__Start__Cucumbers() | |
{ | |
// Do nothing, BDDfy will set Start for us | |
} | |
[Step(Title="When I eat <eat> cucumbers")] | |
public void WhenIEatCucumbers(int eat) | |
{ | |
_result = Start - Eat; | |
} | |
[Step(Title="Then I should have <left> cucumbers")] | |
public void ThenIShouldHaveCucumbersLeft() | |
{ | |
_result.ShouldBe(Left); | |
} | |
[DataHeader("Start", "Eat", "Left")] | |
public IEnumerable<object[]> WithExamples() | |
{ | |
yield return new[] { 12, 5, 7 }; | |
yield return new[] { 20, 5, 15 }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment