Skip to content

Commit f8fcc7c

Browse files
committed
Merge pull request #30 from MehdiK/sample-change
Cleaning up samples and adding a simple BDDfy Rocks one
2 parents c6bdd91 + a8d31f1 commit f8fcc7c

18 files changed

+72
-23
lines changed

Packages.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<PropertyGroup>
20-
<BDDfySamplesPath>$(MSBuildProjectDirectory)\TestStack.BDDfy.Samples</BDDfySamplesPath>
20+
<BDDfySamplesPath>$(MSBuildProjectDirectory)\Samples\TestStack.BDDfy.Samples</BDDfySamplesPath>
2121
<BDDfySpecPath>$(PackageDefinitionPath)\TestStack.BDDfy</BDDfySpecPath>
2222
<BDDfySpec>$(BDDfySpecPath)\TestStack.BDDfy.nuspec</BDDfySpec>
2323
<SamplesSpecPath>$(PackageDefinitionPath)\TestStack.BDDfy.Samples</SamplesSpecPath>

TestStack.BDDfy.Samples/Atm/AccountHasInsufficientFund.cs renamed to Samples/TestStack.BDDfy.Samples/Atm/AccountHasInsufficientFund.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,11 @@ void And_the_Card_should_be_returned()
5050
{
5151
Assert.IsFalse(_atm.CardIsRetained);
5252
}
53+
54+
[Test]
55+
public void Verify()
56+
{
57+
this.BDDfy<AccountHolderWithdrawsCash>();
58+
}
5359
}
5460
}

TestStack.BDDfy.Samples/Atm/AccountHolderWithdrawsCash.cs renamed to Samples/TestStack.BDDfy.Samples/Atm/AccountHolderWithdrawsCash.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ void And_the_ATM_should_say_the_Card_has_been_retained()
6464
Assert.AreEqual(DisplayMessage.CardIsRetained, _atm.Message);
6565
}
6666

67-
[Test]
68-
public void AccountHasInsufficientFund()
69-
{
70-
new AccountHasInsufficientFund().BDDfy<AccountHolderWithdrawsCash>();
71-
}
72-
7367
[Test]
7468
public void AccountHasSufficientFund()
7569
{
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using NUnit.Framework;
2+
using TestStack.BDDfy.Core;
3+
using TestStack.BDDfy.Scanners.StepScanners.Fluent;
4+
5+
namespace TestStack.BDDfy.Samples
6+
{
7+
[Story(
8+
AsA = "As a .Net programmer",
9+
IWant = "I want to use BDDfy",
10+
SoThat = "So that BDD becomes easy and fun")]
11+
public class BDDfy_Rocks
12+
{
13+
void Given_I_have_not_used_BDDfy_before()
14+
{
15+
}
16+
17+
void WhenIAmIntroducedToTheFramework()
18+
{
19+
}
20+
21+
void ThenILikeItAndStartUsingIt()
22+
{
23+
}
24+
25+
void AndTheQualityAndMaintainabilityOfMyTestSkyrocket()
26+
{
27+
}
28+
29+
[Test]
30+
public void BDDfy_with_reflective_API()
31+
{
32+
this.BDDfy();
33+
}
34+
35+
[Test]
36+
public void BDDfy_with_fluent_API()
37+
{
38+
this.Given(_ => Given_I_have_not_used_BDDfy_before())
39+
.When(_ => WhenIAmIntroducedToTheFramework())
40+
.Then(_ => ThenILikeItAndStartUsingIt())
41+
.And(_ => AndTheQualityAndMaintainabilityOfMyTestSkyrocket())
42+
.BDDfy();
43+
}
44+
}
45+
}

TestStack.BDDfy.Samples/TicTacToe/CustomTextReporter.cs renamed to Samples/TestStack.BDDfy.Samples/CustomTextReporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.IO;
3-
using System.Text;
43
using System.Linq;
4+
using System.Text;
55
using TestStack.BDDfy.Core;
66

7-
namespace TestStack.BDDfy.Samples.TicTacToe
7+
namespace TestStack.BDDfy.Samples
88
{
99
/// <summary>
1010
/// This is a custom reporter that shows you how easily you can create a custom report.

TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj renamed to Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,22 @@
4949
<Compile Include="Atm\AccountHolderWithdrawsCash.cs" />
5050
<Compile Include="Atm\HtmlReportConfig.cs" />
5151
<Compile Include="BDDfyConfiguration.cs" />
52+
<Compile Include="BDDfy_Rocks.cs" />
5253
<Compile Include="TicTacToe\Game.cs" />
5354
<Compile Include="TicTacToe\Helpers.cs" />
54-
<Compile Include="TicTacToe\CustomTextReporter.cs" />
55+
<Compile Include="CustomTextReporter.cs" />
5556
<Compile Include="TicTacToe\TicTacToe.cs" />
5657
<Compile Include="TicTacToe\WinnerGame.cs" />
5758
<Compile Include="TicTacToe\XWins.cs" />
5859
</ItemGroup>
5960
<ItemGroup>
6061
<Reference Include="nunit.framework">
61-
<HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
62+
<HintPath>..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
6263
</Reference>
6364
<Reference Include="System" />
6465
</ItemGroup>
6566
<ItemGroup>
66-
<ProjectReference Include="..\TestStack.BDDfy\TestStack.BDDfy.csproj">
67+
<ProjectReference Include="..\..\TestStack.BDDfy\TestStack.BDDfy.csproj">
6768
<Project>{DA6BCB39-307C-4A8E-9A3A-27BB2DBC44A3}</Project>
6869
<Name>TestStack.BDDfy</Name>
6970
</ProjectReference>
File renamed without changes.

0 commit comments

Comments
 (0)