@@ -16,10 +16,18 @@ public void MethodCallInStepTitle()
1616 var story = this
1717 . Given ( _ => GivenWeMutateSomeState ( ) )
1818 . When ( _ => something . Sub . SomethingHappens ( ) )
19+ . And ( _ => something . Sub . SomethingWithDifferentTitle ( ) )
1920 . Then ( _ => ThenTitleHas ( AMethodCall ( ) ) )
21+ . And ( _ => something . Sub . SomethingWithArg ( "foo" ) )
22+ . And ( _ => something . Sub . SomethingWithArg2 ( "foo" ) )
23+ . And ( _ => something . Sub . SomethingWithArg3 ( "foo" ) )
2024 . BDDfy ( ) ;
2125
22- story . Scenarios . Single ( ) . Steps . ElementAt ( 2 ) . Title . ShouldBe ( "Then title has Mutated state" ) ;
26+ story . Scenarios . Single ( ) . Steps . ElementAt ( 2 ) . Title . ShouldBe ( "And different title" ) ;
27+ story . Scenarios . Single ( ) . Steps . ElementAt ( 3 ) . Title . ShouldBe ( "Then title has Mutated state" ) ;
28+ story . Scenarios . Single ( ) . Steps . ElementAt ( 4 ) . Title . ShouldBe ( "And with arg foo" ) ;
29+ story . Scenarios . Single ( ) . Steps . ElementAt ( 5 ) . Title . ShouldBe ( "And with arg" ) ;
30+ story . Scenarios . Single ( ) . Steps . ElementAt ( 6 ) . Title . ShouldBe ( "And with foo arg" ) ;
2331 }
2432
2533 public class FooClass
@@ -38,6 +46,26 @@ public void SomethingHappens()
3846 {
3947
4048 }
49+
50+ [ StepTitle ( "Different title" ) ]
51+ public void SomethingWithDifferentTitle ( )
52+ {
53+ }
54+
55+ [ StepTitle ( "With arg" ) ]
56+ public void SomethingWithArg ( string arg )
57+ {
58+ }
59+
60+ [ StepTitle ( "With arg" , false ) ]
61+ public void SomethingWithArg2 ( string arg )
62+ {
63+ }
64+
65+ [ StepTitle ( "With {0} arg" , false ) ]
66+ public void SomethingWithArg3 ( string arg )
67+ {
68+ }
4169 }
4270
4371 private string AMethodCall ( )
0 commit comments