33using System . Linq . Expressions ;
44using System . Reflection ;
55using System . Linq ;
6-
7- #if ! NET35
86using System . Threading . Tasks ;
9- #endif
107
118namespace TestStack . BDDfy
129{
@@ -57,55 +54,7 @@ IScanner IHasScanner.GetScanner(string scenarioTitle, Type explicitStoryType)
5754 {
5855 return new DefaultScanner ( _testObject , new FluentScenarioScanner ( _steps , scenarioTitle ) , explicitStoryType ) ;
5956 }
60- #if NET35
61- public void AddStep ( Expression < Action < TScenario > > stepAction , string stepTextTemplate , bool asserts , ExecutionOrder executionOrder )
62- {
63- AddStep ( stepAction , stepTextTemplate , asserts , executionOrder , true ) ;
64- }
65-
66- public IWhen < TScenario > When ( Expression < Action < TScenario > > whenStep )
67- {
68- AddStep ( whenStep , null , false , ExecutionOrder . Transition ) ;
69- return this ;
70- }
71-
72- public IGiven < TScenario > Given ( Expression < Action < TScenario > > givenStep )
73- {
74- return Given ( givenStep , null ) ;
75- }
76-
77- IWhen < TScenario > IGiven < TScenario > . When ( Expression < Action < TScenario > > whenStep )
78- {
79- return When ( whenStep ) ;
80- }
81-
82- IThen < TScenario > IWhen < TScenario > . Then ( Expression < Action < TScenario > > thenStep )
83- {
84- AddStep ( thenStep , null , true , ExecutionOrder . Assertion ) ;
85- return this ;
86- }
87-
88- IThen < TScenario > IGiven < TScenario > . Then ( Expression < Action < TScenario > > thenStep )
89- {
90- AddStep ( thenStep , null , true , ExecutionOrder . Assertion ) ;
91- return this ;
92- }
93-
94- IAndThen < TScenario > IThen < TScenario > . And ( Expression < Action < TScenario > > andThenStep )
95- {
96- return ( ( IThen < TScenario > ) this ) . And ( andThenStep , null ) ;
97- }
98-
99- IAndWhen < TScenario > IWhen < TScenario > . And ( Expression < Action < TScenario > > andWhenStep )
100- {
101- return ( ( IWhen < TScenario > ) this ) . And ( andWhenStep , null ) ;
102- }
103-
104- IAndGiven < TScenario > IGiven < TScenario > . And ( Expression < Action < TScenario > > andGivenStep )
105- {
106- return ( ( IGiven < TScenario > ) this ) . And ( andGivenStep , null ) ;
107- }
108- #else
57+
10958 IGiven < TScenario > IInitialStep < TScenario > . Given ( Expression < Func < TScenario , Task > > givenStep , string stepTextTemplate )
11059 {
11160 AddStep ( givenStep , stepTextTemplate , false , ExecutionOrder . SetupState ) ;
@@ -238,7 +187,6 @@ private static MethodInfo GetMethodInfo(Expression<Func<TScenario, Task>> stepAc
238187 var methodCall = ( MethodCallExpression ) stepAction . Body ;
239188 return methodCall . Method ;
240189 }
241- #endif
242190
243191 private void AddStep ( Expression < Action < TScenario > > stepAction , string stepTextTemplate , bool asserts , ExecutionOrder executionOrder , bool reports = true , bool includeInputsInStepTitle = true )
244192 {
@@ -373,4 +321,4 @@ private static MethodInfo GetMethodInfo(Expression<Action<TScenario>> stepAction
373321 return methodCall . Method ;
374322 }
375323 }
376- }
324+ }
0 commit comments