@@ -5,25 +5,22 @@ namespace TestStack.BDDfy
55 public class DefaultMethodNameStepScanner : MethodNameStepScanner
66 {
77 public DefaultMethodNameStepScanner ( )
8- : base ( CleanupTheStepText ,
9- new [ ]
10- {
11- new MethodNameMatcher ( s => s . EndsWith ( "Context" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . Initialize , false ) ,
12- new MethodNameMatcher ( s => s . Equals ( "Setup" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . Initialize , false ) ,
13- new MethodNameMatcher ( s => s . StartsWith ( "Given" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . SetupState , true ) ,
14- new MethodNameMatcher ( s => s . StartsWith ( "AndGiven" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . ConsecutiveSetupState , true ) ,
15- new MethodNameMatcher ( s => s . StartsWith ( "And_Given_" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . ConsecutiveSetupState , true ) ,
16- new MethodNameMatcher ( s => s . StartsWith ( "When" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . Transition , true ) ,
17- new MethodNameMatcher ( s => s . StartsWith ( "AndWhen" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . ConsecutiveTransition , true ) ,
18- new MethodNameMatcher ( s => s . StartsWith ( "And_When_" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . ConsecutiveTransition , true ) ,
19- new MethodNameMatcher ( s => s . StartsWith ( "Then" , StringComparison . OrdinalIgnoreCase ) , true , ExecutionOrder . Assertion , true ) ,
20- new MethodNameMatcher ( s => s . StartsWith ( "And" , StringComparison . OrdinalIgnoreCase ) , true , ExecutionOrder . ConsecutiveAssertion , true ) ,
21- new MethodNameMatcher ( s => s . StartsWith ( "AndThen" , StringComparison . OrdinalIgnoreCase ) , true , ExecutionOrder . ConsecutiveAssertion , true ) ,
22- new MethodNameMatcher ( s => s . StartsWith ( "And_Then_" , StringComparison . OrdinalIgnoreCase ) , true , ExecutionOrder . ConsecutiveAssertion , true ) ,
23- new MethodNameMatcher ( s => s . StartsWith ( "But" , StringComparison . OrdinalIgnoreCase ) , true , ExecutionOrder . ConsecutiveAssertion , true ) ,
24- new MethodNameMatcher ( s => s . StartsWith ( "TearDown" , StringComparison . OrdinalIgnoreCase ) , false , ExecutionOrder . TearDown , false )
25- } )
8+ : base ( CleanupTheStepText )
269 {
10+ AddMatcher ( new MethodNameMatcher ( s => s . EndsWith ( "Context" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . Initialize ) { ShouldReport = false } ) ;
11+ AddMatcher ( new MethodNameMatcher ( s => s . Equals ( "Setup" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . Initialize ) { ShouldReport = false } ) ;
12+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "Given" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . SetupState ) ) ;
13+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "AndGiven" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveSetupState ) ) ;
14+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "And_Given_" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveSetupState ) ) ;
15+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "When" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . Transition ) ) ;
16+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "AndWhen" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveTransition ) ) ;
17+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "And_When_" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveTransition ) ) ;
18+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "Then" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . Assertion ) { Asserts = true } ) ;
19+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "And" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveAssertion ) { Asserts = true } ) ;
20+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "AndThen" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveAssertion ) { Asserts = true } ) ;
21+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "And_Then_" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveAssertion ) { Asserts = true } ) ;
22+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "But" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . ConsecutiveAssertion ) { Asserts = true } ) ;
23+ AddMatcher ( new MethodNameMatcher ( s => s . StartsWith ( "TearDown" , StringComparison . OrdinalIgnoreCase ) , ExecutionOrder . TearDown ) { ShouldReport = false } ) ;
2724 }
2825
2926 static string CleanupTheStepText ( string stepText )
0 commit comments