File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed
ReqnrollFormatters/ReqnrollFormatters.Standard Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Scenario: Passing scenario
15
15
Scenario : Failing scenario
16
16
When I do something
17
17
Then the scenario fails
18
+ And nothing else matters
18
19
19
20
Scenario Outline : Outline with multiple examples
20
21
Given the first parameter is "<param>"
Original file line number Diff line number Diff line change
1
+ @dynamicignore
2
+ Feature : DynamicIgnore
3
+
4
+ @ignore
5
+ Scenario : Ignored scenario
6
+ When I do something
7
+
8
+ Scenario Outline : Outline with ignored examples
9
+ Given the first parameter is "<param>"
10
+ And <other param> is the second parameter
11
+ When I do something
12
+ Then the scenario <result>
13
+ Examples :
14
+ | param | other param | result |
15
+ | foo bar | 12 | passes |
16
+ @ignore
17
+ Examples : Ignored tests
18
+ | param | other param | result |
19
+ | hello | 12 | passes |
20
+
21
+ Scenario : Dynamically ignored
22
+ Given the scenario is ignored
23
+ When I do something
24
+
25
+ Scenario : Dynamically marked inconclusive
26
+ Given the scenario is marked inconclusive
27
+ When I do something
28
+
29
+ Scenario : Pending scenario
30
+ Given the scenario is pending
31
+ When I do something
Original file line number Diff line number Diff line change 1
1
using Reqnroll ;
2
+ using Reqnroll . UnitTestProvider ;
2
3
3
4
namespace ReqnrollFormatters . Standard . StepDefinitions ;
4
5
5
6
[ Binding ]
6
- public sealed class ProjectStepDefinitions ( IReqnrollOutputHelper outputHelper )
7
+ public sealed class ProjectStepDefinitions ( IReqnrollOutputHelper outputHelper , ScenarioContext scenarioContext )
7
8
{
8
9
[ When ( "I do something" ) ]
9
10
public void WhenIDoSomething ( )
@@ -16,6 +17,11 @@ public void ThenTheScenarioFails()
16
17
throw new Exception ( "simulated error" ) ;
17
18
}
18
19
20
+ [ Then ( "nothing else matters" ) ]
21
+ public void ThenNothingElseMatters ( )
22
+ {
23
+ }
24
+
19
25
[ Given ( "the first parameter is {string}" ) ]
20
26
public void GivenTheFirstParameterIs ( string firstParam )
21
27
{
@@ -54,4 +60,22 @@ public void AfterAttachmentScenario()
54
60
{
55
61
outputHelper . WriteLine ( "after attachment scenario hook executed" ) ;
56
62
}
63
+
64
+ [ Given ( "the scenario is ignored" ) ]
65
+ public void GivenTheScenarioIsIgnored ( )
66
+ {
67
+ scenarioContext . ScenarioContainer . Resolve < IUnitTestRuntimeProvider > ( ) . TestIgnore ( "This is ignored!" ) ;
68
+ }
69
+
70
+ [ Given ( "the scenario is marked inconclusive" ) ]
71
+ public void GivenTheScenarioIsMarkedInconclusive ( )
72
+ {
73
+ scenarioContext . ScenarioContainer . Resolve < IUnitTestRuntimeProvider > ( ) . TestIgnore ( "This is inconclusive!" ) ;
74
+ }
75
+
76
+ [ Given ( "the scenario is pending" ) ]
77
+ public void GivenTheScenarioIsPending ( )
78
+ {
79
+ throw new PendingStepException ( ) ;
80
+ }
57
81
}
You can’t perform that action at this time.
0 commit comments