@@ -49,30 +49,21 @@ static Engine InternalLazyBDDfy(
4949 string storyCategory ,
5050 Type explicitStoryType = null )
5151 {
52- var storyScanner = GetFluentScanner ( testObject , scenarioTitle , explicitStoryType ) ?? GetReflectiveScanner ( testObject , scenarioTitle , explicitStoryType ) ;
52+ var testContext = TestContext . GetContext ( testObject ) ;
53+
54+ var storyScanner = testContext . FluentScanner != null ?
55+ testContext . FluentScanner . GetScanner ( scenarioTitle , explicitStoryType ) :
56+ GetReflectiveScanner ( testContext , scenarioTitle , explicitStoryType ) ;
5357
5458 return new Engine ( storyCategory , storyScanner ) ;
5559 }
5660
57- static IScanner GetReflectiveScanner ( object testObject , string scenarioTitle = null , Type explicitStoryType = null )
61+ static IScanner GetReflectiveScanner ( ITestContext testContext , string scenarioTitle = null , Type explicitStoryType = null )
5862 {
59- var testContext = TestContext . GetContext ( testObject ) ;
6063 var stepScanners = Configurator . Scanners . GetStepScanners ( testContext ) . ToArray ( ) ;
6164 var reflectiveScenarioScanner = new ReflectiveScenarioScanner ( scenarioTitle , stepScanners ) ;
6265
6366 return new DefaultScanner ( testContext , reflectiveScenarioScanner , explicitStoryType ) ;
6467 }
65-
66- static IScanner GetFluentScanner ( object testObject , string scenarioTitle , Type explicitStoryType )
67- {
68- IScanner scanner = null ;
69-
70- var fluentScanner = testObject as IFluentScanner ;
71-
72- if ( fluentScanner != null )
73- scanner = fluentScanner . GetScanner ( scenarioTitle , explicitStoryType ) ;
74-
75- return scanner ;
76- }
7768 }
7869}
0 commit comments