Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
71d006d
mocked up the APIs
MehdiK Apr 5, 2014
79dbd9f
Fixing the NetToString logic to cater for Pascal & Underscored names
MehdiK Apr 5, 2014
409a32e
removed now unnecessary BDDfy extensions
MehdiK Apr 5, 2014
a09e3f2
Refactored fluent scanner interfaces a bit
MehdiK Apr 5, 2014
ecb4737
fetch the testobject if it's examples & set example rows on scenario
MehdiK Apr 5, 2014
85f78df
renaming hasScanner to fluentScanner for readability
MehdiK Apr 5, 2014
5836608
Can now run examples with method name conventions
MehdiK Apr 5, 2014
0a52a49
Console reporter now shows successful examples on the bottom
MehdiK Apr 5, 2014
c7deb24
ExecutableAttribute scanner can now deal examples
MehdiK Apr 5, 2014
f4bf933
Added nCrunch files
Apr 5, 2014
cb460a5
Cleaning up fluent API a little bit
Apr 5, 2014
27cd78f
Refactoring the way examples work
Apr 5, 2014
2c10277
Lazy arguments which are evaluated when the step is executed so SUT i…
Apr 5, 2014
c88ed98
Moved prepare object into the fluent scenario scanner
Apr 5, 2014
ed579d2
Clone steps otherwise we mark other examples steps as failed
Apr 5, 2014
84fcd0c
Fixed console report for fluent
Apr 5, 2014
45481b4
Missed step ctor overload from previous commit
Apr 5, 2014
49e8224
Added approval test (which for some reason is not working :S) around …
Apr 5, 2014
00217f9
Removed tabs in Console/Text reporter
Apr 5, 2014
ac70944
Title is calcualted at scan time again
Apr 6, 2014
6b43eb7
Moved ExpressionExtensionsTests into FluentScanners folder
Apr 6, 2014
2dca809
Fixed reporting exceptions
Apr 6, 2014
bebc654
Removed TODO
Apr 6, 2014
38ad5e3
Introduced ExampleTable
Apr 6, 2014
70767b2
Minor cleanup
Apr 6, 2014
50714f6
Removed approval test, not sure why its failing
Apr 6, 2014
9a581bb
Added tostring on Example
Apr 6, 2014
70a255f
Fixed another TODO
Apr 6, 2014
f17661e
Merge pull request #90 from JakeGinnivan/FluentExample
JakeGinnivan Apr 6, 2014
a88adb2
moved the example tests to the sample project & refactored it
MehdiK Apr 6, 2014
a70e24d
reflective-api examples now run
MehdiK Apr 6, 2014
3644901
console report now shows result & error cols conditionally
MehdiK Apr 6, 2014
def9407
removed StoryCache fiddling so Async can report to files
MehdiK Apr 6, 2014
0e6828d
Merge pull request #91 from MehdiK/reflective-api
mwhelan Apr 6, 2014
7d0897d
can inline title only steps
MehdiK Apr 6, 2014
622d175
Merge pull request #92 from MehdiK/reports
mwhelan Apr 6, 2014
8f42e2f
fixed the bug where scenario was being inited for every step
MehdiK Apr 6, 2014
1650868
moved Execute out of scenario into new ScenarioExecutor
MehdiK Apr 6, 2014
c9413aa
Merge pull request #93 from MehdiK/bug
JakeGinnivan Apr 6, 2014
e8e2546
changed the way example table is printed in TextReporter to deal /w R…
MehdiK Apr 6, 2014
88432d9
Merge remote-tracking branch 'upstream/master' into examples
Apr 10, 2014
f632ceb
Tab to space on metro report
Apr 10, 2014
267b284
Approved tab to space in test
Apr 10, 2014
8ffa782
Switched markdown builder test to use approval tests
Apr 10, 2014
24313b8
Updated HTML test to actually have passing and failing scenarios
Apr 9, 2014
31c9585
Updated HTML report for examples
Apr 9, 2014
618fc50
Fixed approval tests (paths not scrubbed)
Apr 9, 2014
a05b32a
Fixing git attributes
Apr 9, 2014
67b5d8f
Fixed line endings on approved files
Apr 9, 2014
0edff69
Using line ending scrubber to make sure line endings are consistent
Apr 10, 2014
b198b2a
Scrubber for metro html report
Apr 10, 2014
7ac083b
just minor tidy up of HtmlReportBuilder
MehdiK Apr 10, 2014
fa32814
Merge branch 'html-report' into examples
MehdiK Apr 10, 2014
581b7d2
Moved prepare test object into scenario executor so it works for both…
Apr 10, 2014
c158b50
Removed unused namespaces
Apr 10, 2014
196094c
Added test for injected properties
Apr 13, 2014
ab810d1
Added a few NetToString tests
Apr 13, 2014
470abab
Added fluent test using examples
Apr 13, 2014
8379009
Fixed line endings on approved files
Apr 13, 2014
8378759
Moved UseReporter into AssemblyInfo
Apr 13, 2014
32f08b0
Added reflective test using examples and now match parameters by look…
Apr 13, 2014
3816e40
Moved NetToStringTests to the right spot
Apr 13, 2014
3ac6bed
Removed duplicated test
Apr 13, 2014
046053f
Merge pull request #103 from JakeGinnivan/InjectExamplesIntoPropertie…
MehdiK Apr 14, 2014
6a9c8e5
Dropped IExampleTable interface
Apr 14, 2014
e1d5644
Allowed example tables to convert the values to the target type
Apr 14, 2014
00ac022
Made it work with a few more types
Apr 15, 2014
b012b78
Small test change
Apr 15, 2014
02993c6
Fixing some issues raised in review
Apr 15, 2014
4b83337
Further review updates
Apr 15, 2014
ad266af
Fixed last two issues
Apr 15, 2014
096e753
Merge pull request #109 from JakeGinnivan/TextTable
MehdiK Apr 15, 2014
304aeb3
Merge remote-tracking branch 'upstream/master' into examples
Apr 15, 2014
54cb3c0
Fixed merge issue
Apr 15, 2014
614f046
Fixed merge issue
Apr 15, 2014
90fe3cb
Allow spaces in headers
Apr 15, 2014
fe87792
Refactored the Header to parameter name logic as per discussion with …
MehdiK Apr 16, 2014
c1aadf4
Support private fields
Apr 16, 2014
dcc121c
Throw when value is unused
Apr 16, 2014
01308f4
Made step title a type
Apr 16, 2014
dfea6b9
Introduced TestContext rather than wrapping test objects multiple times
Apr 16, 2014
dc72251
Better title for fluent in some scenarios
Apr 16, 2014
db7d9e8
Fixed fluent API so examples can be declared first (before GWT)
Apr 16, 2014
a0fb7e5
Changed ITestContext to be statically keyed on TestObject
Apr 17, 2014
d60dabc
Merge pull request #115 from JakeGinnivan/ImprovingTitles
MehdiK Apr 17, 2014
7998649
setting the _prop2 to fix the CI build
MehdiK Apr 17, 2014
1e2e1da
Merge pull request #116 from MehdiK/fixing-test-project
JakeGinnivan Apr 17, 2014
be73614
refactored file report approval tests
MehdiK Apr 16, 2014
809235f
HtmlReportViewModel renamed to HtmlReportModel
MehdiK Apr 16, 2014
3f2b3e8
restructured the classic & metro html reports
MehdiK Apr 16, 2014
04b16c4
changed metro report to be generated in code instead of T4
MehdiK Apr 16, 2014
c038f33
Added example table support to metro html report
MehdiK Apr 17, 2014
1e7edb4
Approval test for metro html report /w examples
MehdiK Apr 17, 2014
8fef0f9
small changes on html reports' styling
MehdiK Apr 17, 2014
2f4f094
Merge pull request #112 from MehdiK/example-on-metro-report
JakeGinnivan Apr 17, 2014
3109828
Progress
Apr 17, 2014
2ce11ef
Some final cleanups
Apr 17, 2014
7cd1216
Added useful comment in T4 file
Apr 17, 2014
9319ba9
Merge pull request #117 from JakeGinnivan/GenerateFluentApi
MehdiK Apr 18, 2014
cb83b76
covered more cases in the NetToString for examples
MehdiK Apr 28, 2014
24aff01
refactored NetToString & fixed a few issues
MehdiK Apr 28, 2014
3873bfd
added in dotsettings & excluded a few folders from R# namespace provider
MehdiK Apr 28, 2014
9dea591
using Configurator.Humanize instead of NetToString everywhere
MehdiK Apr 28, 2014
9107453
Merge pull request #119 from TestStack/nettostring
JakeGinnivan Apr 28, 2014
f0daf4c
Added resharper solution dotsettings file
Apr 28, 2014
871d8a5
Allowed complex fluent tests (with steps in different order than just…
Apr 28, 2014
513d447
Fixed issue with BDDfy conflicting with nSubstitute
Apr 29, 2014
bc87dad
Now properly doesn't conflict with nSubsitute
Apr 29, 2014
ba9903a
Fixing issue with empty string in examples causing value not to be us…
Apr 29, 2014
26eb403
Added this.When support back
Apr 29, 2014
4101627
Renamed FluentTestBuilder to FluentStepBuilder
MehdiK Apr 29, 2014
452ec82
Merge branch 'ComplexFluent' into examples
MehdiK Apr 29, 2014
cb9db3d
Supporting complex types in examples, and expanded expression parser …
Apr 30, 2014
e09a23b
Trying to fix failing approval test on build server
Apr 30, 2014
eb2f42f
Tollerate null references in Argument Expression
Apr 30, 2014
cf0991a
Switched to normal assertion
Apr 30, 2014
1b3b135
Fixing review feedback
Apr 30, 2014
42c2e22
Merge pull request #122 from JakeGinnivan/ComplexTypes
JakeGinnivan Apr 30, 2014
647f460
added approved files to test project
MehdiK Apr 30, 2014
4a7f6de
added tests for textreporter & fixed a bug with exception reporting
MehdiK Apr 30, 2014
681d69d
added TextReport tests for examples
MehdiK Apr 30, 2014
5dc3ec9
Merge pull request #123 from MehdiK/text-reporter
JakeGinnivan May 1, 2014
9bf03bb
Updated markdown report for examples
May 1, 2014
172460a
Allowed consecutive assertions to fail, but if followed by a non-asse…
May 1, 2014
7986985
Html Encoding step titles
May 2, 2014
594ee4d
Cleaned up logic a bit after review
May 2, 2014
290e874
Merge pull request #128 from JakeGinnivan/StepExecutionWithErrors
JakeGinnivan May 2, 2014
bc22ded
Merge pull request #126 from JakeGinnivan/MarkdownReport
JakeGinnivan May 2, 2014
9d1aa5e
Text reporter only flattens \r\n, changed to flatten \n too
May 2, 2014
c54b23d
Fixing markdown report too
May 2, 2014
52bc89d
Merge pull request #129 from JakeGinnivan/FormatLineFeedInTextReporter
JakeGinnivan May 2, 2014
642cf70
Added outlike of example test
May 2, 2014
4d0647c
Can now declare a local variable inside the test method, and BDDfy wi…
May 2, 2014
efaaf4b
Fixed tests
May 2, 2014
2c4b919
Allow step title placeholders when matching variable is passed in as …
May 2, 2014
fedae8a
Moved step arguments class into it's own file
May 2, 2014
1bea54e
Merge pull request #132 from JakeGinnivan/BuyingTrainTicketsExample
MehdiK May 4, 2014
a40075d
Merge pull request #134 from JakeGinnivan/LocalVariableExamplePlaceho…
MehdiK May 4, 2014
327cfec
Added another assertion step to do with complex tests
May 4, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@

# Denote all files that are truly binary and should not be modified.
*.exe binary
*.dll binary
*.dll binary

*.approved.* binary
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bin/
obj/
*.user
*.suo
*.DotSettings
*~
*.swp
*.orig
Expand Down
3 changes: 1 addition & 2 deletions Samples/TestStack.BDDfy.Samples/BDDfyConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using NUnit.Framework;
using TestStack.BDDfy.Configuration;
using TestStack.BDDfy.Reporters.Html;
using TestStack.BDDfy.Reporters.HtmlMetro;
using TestStack.BDDfy.Samples.Atm;

namespace TestStack.BDDfy.Samples
Expand All @@ -15,7 +14,7 @@ public void Config()
Configurator.Processors.Add(() => new CustomTextReporter());
Configurator.BatchProcessors.MarkDownReport.Enable();
Configurator.BatchProcessors.DiagnosticsReport.Enable();
Configurator.BatchProcessors.Add(new HtmlReporter(new AtmHtmlReportConfig(), new HtmlMetroReportBuilder()));
Configurator.BatchProcessors.Add(new HtmlReporter(new AtmHtmlReportConfig(), new MetroReportBuilder()));
}
}
}
59 changes: 59 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFareWithExamples.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using NUnit.Framework;
using TestStack.BDDfy.Samples.BuyingTrainFares;

namespace TestStack.BDDfy.Samples
{
[TestFixture]
public class BuyingTrainFareWithExamples
{
private Fare fare;
private BuyerCategory _buyerCategory;
Money Price { get; set; }

[Test]
public void SuccessfulRailCardPurchases()
{
this.Given(_ => TheBuyerIsA(_buyerCategory))
.And(_ => TheBuyerSelectsA(fare))
.When(_ => TheBuyerPays())
.Then(_ => ASaleOccursWithAnAmountOf(Price))
.WithExamples(new ExampleTable(
"Buyer Category", "Fare", "Price")
{
{BuyerCategory.Student, new MonthlyPass(), new Money(76)},
{BuyerCategory.Senior, new MonthlyPass(), new Money(98)},
{BuyerCategory.Standard, new MonthlyPass(), new Money(146)},
{BuyerCategory.Student, new WeeklyPass(), new Money(23)},
{BuyerCategory.Senior, new WeeklyPass(), new Money(30)},
{BuyerCategory.Standard, new WeeklyPass(), new Money(44)},
{BuyerCategory.Student, new DayPass(), new Money(4)},
{BuyerCategory.Senior, new DayPass(), new Money(5)},
{BuyerCategory.Standard, new DayPass(), new Money(7)},
{BuyerCategory.Student, new SingleTicket(), new Money(1.5m)},
{BuyerCategory.Senior, new SingleTicket(), new Money(2m)},
{BuyerCategory.Standard, new SingleTicket(), new Money(3m)}
})
.BDDfy("Successful rail card purchases");
}

void TheBuyerIsA(BuyerCategory buyerCategory)
{

}

void TheBuyerSelectsA(Fare fare)
{

}

void TheBuyerPays()
{

}

void ASaleOccursWithAnAmountOf(Money price)
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
enum BuyerCategory
{
Student,
Senior,
Standard
}
}
10 changes: 10 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/DayPass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class DayPass : Fare
{
public override string ToString()
{
return "Day Pass";
}
}
}
7 changes: 7 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/Fare.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class Fare
{

}
}
47 changes: 47 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/Money.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Globalization;

namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class Money
{
public Money(decimal amount)
{
Amount = amount;
}

public decimal Amount { get; set; }

protected bool Equals(Money other)
{
return Amount == other.Amount;
}

public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((Money)obj);
}

public override int GetHashCode()
{
return Amount.GetHashCode();
}

public static bool operator ==(Money left, Money right)
{
return Equals(left, right);
}

public static bool operator !=(Money left, Money right)
{
return !Equals(left, right);
}

public override string ToString()
{
return Amount.ToString("C", CultureInfo.CreateSpecificCulture("EN-US"));
}
}
}
10 changes: 10 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/MonthlyPass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class MonthlyPass : Fare
{
public override string ToString()
{
return "Monthly Pass";
}
}
}
10 changes: 10 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/SingleTicket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class SingleTicket : Fare
{
public override string ToString()
{
return "Day Pass";
}
}
}
10 changes: 10 additions & 0 deletions Samples/TestStack.BDDfy.Samples/BuyingTrainFares/WeeklyPass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TestStack.BDDfy.Samples.BuyingTrainFares
{
class WeeklyPass : Fare
{
public override string ToString()
{
return "Weekly Pass";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TestStack.BDDfy.Samples
{
public class AsyncExample
public class CanRunAsyncSteps
{
private Sut _sut;

Expand Down Expand Up @@ -33,19 +33,10 @@ private async Task<Sut> CreateSut()
[Test]
public void Run()
{
try
{
// we need TestObject for this test; so I disable StoryCache processor for this one test
Configuration.Configurator.Processors.StoryCache.Disable();
var engine = this.LazyBDDfy();
var exception = Assert.Throws<Exception>(() => engine.Run());

Assert.AreEqual("Exception in async void method!!", exception.Message);
}
finally
{
Configuration.Configurator.Processors.StoryCache.Enable();
}
var engine = this.LazyBDDfy();
var exception = Assert.Throws<Exception>(() => engine.Run());

Assert.AreEqual("Exception in async void method!!", exception.Message);
}

internal class Sut
Expand Down
12 changes: 11 additions & 1 deletion Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Compile Include="AsyncExample.cs" />
<Compile Include="BuyingTrainFares\BuyerCategory.cs" />
<Compile Include="BuyingTrainFares\DayPass.cs" />
<Compile Include="BuyingTrainFares\Fare.cs" />
<Compile Include="BuyingTrainFares\Money.cs" />
<Compile Include="BuyingTrainFares\MonthlyPass.cs" />
<Compile Include="BuyingTrainFares\SingleTicket.cs" />
<Compile Include="BuyingTrainFares\WeeklyPass.cs" />
<Compile Include="BuyingTrainFareWithExamples.cs" />
<Compile Include="CanRunAsyncSteps.cs" />
<Compile Include="Atm\AccountHasInsufficientFund.cs" />
<Compile Include="Atm\Atm.cs" />
<Compile Include="Atm\AccountHolderWithdrawsCash.cs" />
Expand All @@ -58,6 +66,8 @@
<Compile Include="TicTacToe\TicTacToe.cs" />
<Compile Include="TicTacToe\WinnerGame.cs" />
<Compile Include="TicTacToe\XWins.cs" />
<Compile Include="UseExamplesWithReflectiveApi.cs" />
<Compile Include="UseExamplesWithFluentApi.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="nunit.framework">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>
53 changes: 53 additions & 0 deletions Samples/TestStack.BDDfy.Samples/UseExamplesWithFluentApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using NUnit.Framework;

namespace TestStack.BDDfy.Samples
{
[TestFixture]
public class UseExamplesWithFluentApi
{
public int Start { get; set; }
public int Eat { get; set; }
public int Left { get; set; }

[Test]
public void RunExamplesWithFluentApi()
{
this.Given("Given there are <start> cucumbers")
.And(_ => _.AndIStealTwoMore())
.When(_ => _.WhenIEat__eat__Cucumbers())
.Then(_ => _.ThenIShouldHave__left__Cucumbers())
.WithExamples(new ExampleTable("Start", "Eat", "Left")
{
{12, 5, 9},
{20, 5, 17}
})
.BDDfy();
}


// I didn't have to create this method
// because all it was going to do was to set Start property
// which is being handled by the framework
// And the step title is provided inline
//private void GivenThereAre__start__Cucumbers()
//{
//}

private void AndIStealTwoMore()
{
Start += 2;
}

private void WhenIEat__eat__Cucumbers()
{
// This method is called after the Eat property is set by the framework
// I didn't have to put this here, like the Given method, but I put it here to show that
// you can take additional actions here if you want
}

private void ThenIShouldHave__left__Cucumbers()
{
Assert.That(Start - Eat, Is.EqualTo(Left));
}
}
}
45 changes: 45 additions & 0 deletions Samples/TestStack.BDDfy.Samples/UseExamplesWithReflectiveApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using NUnit.Framework;

namespace TestStack.BDDfy.Samples
{
[TestFixture]
public class UseExamplesWithReflectiveApi
{
private int _start;
private int _eat;

[Test]
public void CanRunExamplesWithReflectiveApi()
{
this.WithExamples(new ExampleTable("Start", "Eat", "Left")
{
{12, 5, 7},
{20, 5, 15}
})
.BDDfy();
}

void GivenThereAre__start__Cucumbers(int start)
{
// the start argument is provided by the framework based on the example entries
// please note that `start` argument name matches the `start` header from the examples
// and also it has to match with the <start> placeholder in the step title which is created based on conventions
_start = start;
}

[AndGiven("And I eat <eat> of them")]
void WhenIEatAFewCucumbers(int eat)
{
// the eat argument is provided by the framework based on the example entries
// please note that `eat` argument name matches the `start` header from the examples
// and also it has to match the <eat> placeholder in the step title
_eat = eat;
}

void ThenIShouldHave__left__Cucumbers(int left)
{
// like given and when steps left is provided here because it matches the example header and is found on the step title
Assert.That(_start - _eat, Is.EqualTo(left));
}
}
}
Loading