Skip to content

Commit 24c4470

Browse files
author
Jake Ginnivan
committed
Step type is now prepended onto step title.
1 parent e9dbc63 commit 24c4470

7 files changed

Lines changed: 116 additions & 105 deletions

File tree

TestStack.BDDfy.Tests/Scanner/FluentScanner/FluentWithExamples.FluentCanBeUsedWithExamples.approved.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
Scenario: Fluent can be used with examples
3-
Given method taking <example int>
4-
Given method taking <example int>
5-
Given a different method with random arg 2
6-
Given a different method with <Prop2>
7-
When method using <example string>
8-
And I use a <Multi word heading>
9-
Then all is good
3+
Given method taking <example int>
4+
And method taking <example int>
5+
And a different method with random arg 2
6+
And a different method with <Prop2>
7+
When method using <example string>
8+
And I use a <Multi word heading>
9+
Then all is good
1010

1111
Examples:
1212
| Prop 1 | Prop2 | Prop 3 | Multi word heading |

TestStack.BDDfy.Tests/Scanner/FluentScanner/FluentWithExamples.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public class FluentWithExamples
1313
public void FluentCanBeUsedWithExamples()
1414
{
1515
var story = this
16-
.Given(_ => GivenMethodTaking__ExampleInt__(Prop1), false)
17-
.And(_ => GivenMethodTaking__ExampleInt__(_.Prop1), false)
18-
.And(_ => GivenADifferentMethodWithRandomArg(2))
19-
.And(_ => GivenADifferentMethodWith(_prop2))
16+
.Given(_ => MethodTaking__ExampleInt__(Prop1), false)
17+
.And(_ => MethodTaking__ExampleInt__(_.Prop1), false)
18+
.And(_ => ADifferentMethodWithRandomArg(2))
19+
.And(_ => ADifferentMethodWith(_prop2))
2020
.When(_ => WhenMethodUsing__ExampleString__())
21-
.When(_ => AndIUseA(multiWordHeading))
21+
.And(_ => AndIUseA(multiWordHeading))
2222
.Then(_ => ThenAllIsGood())
2323
.WithExamples(new ExampleTable("Prop 1", "Prop2", "Prop 3", "Multi word heading")
2424
{
@@ -75,12 +75,12 @@ private void AndIUseA(string multiWordHeading)
7575
this.multiWordHeading.ShouldBeOneOf("", "val2");
7676
}
7777

78-
private void GivenADifferentMethodWith(string prop2)
78+
private void ADifferentMethodWith(string prop2)
7979
{
8080
_prop2.ShouldBeOneOf("foo", "bar");
8181
}
8282

83-
private void GivenADifferentMethodWithRandomArg(int foo)
83+
private void ADifferentMethodWithRandomArg(int foo)
8484
{
8585

8686
}
@@ -96,7 +96,7 @@ private void WhenMethodUsing__ExampleString__()
9696
Prop_3.ShouldBeOneOf(ExecutionOrder.ConsecutiveAssertion, ExecutionOrder.Initialize);
9797
}
9898

99-
private void GivenMethodTaking__ExampleInt__(int exampleInt)
99+
private void MethodTaking__ExampleInt__(int exampleInt)
100100
{
101101
exampleInt.ShouldBeInRange(1, 2);
102102
}

TestStack.BDDfy.Tests/Scanner/FluentScanner/WhenStepsAreScannedUsingFluentScanner.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public void GivenSomeState_IsNotAsserting()
4545
[Test]
4646
public void GivenSomeState_StepReports()
4747
{
48-
Assert.IsTrue(GivenSomeStateStep.ShouldReport);
48+
Assert.IsTrue(GivenSomeStateStep.ShouldReport);
4949
}
5050

5151
Step WhenSomeStepUsesIncompatibleNamingConventionStep
5252
{
5353
get
5454
{
55-
return _steps.Single(s => s.Title.Trim() == "When some step uses incompatible naming convention");
55+
return _steps.Single(s => s.Title.Trim() == "And when some step uses incompatible naming convention");
5656
}
5757
}
5858

@@ -71,7 +71,7 @@ public void WhenSomeStepUsesIncompatibleNamingConvention_DoesNotAssert()
7171
[Test]
7272
public void WhenSomeStepUsesIncompatibleNamingConvention_Reports()
7373
{
74-
Assert.IsTrue(WhenSomeStepUsesIncompatibleNamingConventionStep.ShouldReport);
74+
Assert.IsTrue(WhenSomeStepUsesIncompatibleNamingConventionStep.ShouldReport);
7575
}
7676

7777
Step AndAMethodTakesArrayInputsStep
@@ -123,14 +123,14 @@ public void WhenSomethingHappensTransitionStep_DoesNotAssert()
123123
[Test]
124124
public void WhenSomethingHappensTransitionStep_Reports()
125125
{
126-
Assert.IsTrue(WhenSomethingHappensTransitionStep.ShouldReport);
126+
Assert.IsTrue(WhenSomethingHappensTransitionStep.ShouldReport);
127127
}
128128

129129
Step WhenSomethingHappensTransitionStepIgnoringInputInStepTitle
130130
{
131131
get
132132
{
133-
return _steps.Single(s => s.Title == "When something happens");
133+
return _steps.Single(s => s.Title == "And when something happens");
134134
}
135135
}
136136

@@ -149,7 +149,7 @@ public void WhenSomethingHappensTransitionStepIgnoringInputInStepTitle_DoesNotAs
149149
[Test]
150150
public void WhenSomethingHappensTransitionStepIgnoringInputInStepTitle_Reports()
151151
{
152-
Assert.IsTrue(WhenSomethingHappensTransitionStepIgnoringInputInStepTitle.ShouldReport);
152+
Assert.IsTrue(WhenSomethingHappensTransitionStepIgnoringInputInStepTitle.ShouldReport);
153153
}
154154

155155
Step WhenSomethingHappensConsecutiveTransitionStep
@@ -175,7 +175,7 @@ public void WhenSomethingHappensConsecutiveTransitionStep_DoesNotAssert()
175175
[Test]
176176
public void WhenSomethingHappensConsecutiveTransitionStep_Reports()
177177
{
178-
Assert.IsTrue(WhenSomethingHappensConsecutiveTransitionStep.ShouldReport);
178+
Assert.IsTrue(WhenSomethingHappensConsecutiveTransitionStep.ShouldReport);
179179
}
180180

181181
Step AndThenSomethingElseHappensStep
@@ -201,7 +201,7 @@ public void AndThenSomethingElseHappensStep_DoesNotAssert()
201201
[Test]
202202
public void AndThenSomethingElseHappensStep_Reports()
203203
{
204-
Assert.IsTrue(AndThenSomethingElseHappensStep.ShouldReport);
204+
Assert.IsTrue(AndThenSomethingElseHappensStep.ShouldReport);
205205
}
206206

207207
Step ThenTheFollowingAssertionsShouldBeCorrectStep
@@ -253,7 +253,7 @@ public void AndIncorrectAttributeWouldNotMatterStep_DoesAssert()
253253
[Test]
254254
public void AndIncorrectAttributeWouldNotMatterStep_Reports()
255255
{
256-
Assert.IsTrue(AndIncorrectAttributeWouldNotMatterStep.ShouldReport);
256+
Assert.IsTrue(AndIncorrectAttributeWouldNotMatterStep.ShouldReport);
257257
}
258258

259259
Step AndInputsAreFormattedPropertlyInTheTitle
@@ -297,7 +297,7 @@ public void TearDownStep_DoesAssert()
297297
[Test]
298298
public void TearDownStep_DoesNotReports()
299299
{
300-
Assert.IsFalse(TearDownStep.ShouldReport);
300+
Assert.IsFalse(TearDownStep.ShouldReport);
301301
}
302302
}
303303
}

TestStack.BDDfy/Reporters/Html/Scripts/classic.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ li {
3333
background: -o-linear-gradient(top, #679bdb 1%,#3b77a5 100%);
3434
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#679bdb), color-stop(100%,#3b77a5));
3535
background: -webkit-linear-gradient(top, #679bdb 1%,#3b77a5 100%);
36+
/* ReSharper disable once InvalidValue */
3637
background: linear-gradient(top, #679bdb 1%,#3b77a5 100%);
3738
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#679bdb', endColorstr='#3b77a5',GradientType=0 );
3839
/* Chrome,Safari4+ */

0 commit comments

Comments
 (0)