55namespace TestStack . BDDfy . Tests
66{
77 [ TestFixture ]
8- public class HumanizerTests
8+ public class NetToStringTests
99 {
1010 [ Test ]
1111 public void PascalCaseInputStringIsTurnedIntoSentence ( )
1212 {
1313 Assert . That (
14- Configurator . Scanners . Humanize ( "PascalCaseInputStringIsTurnedIntoSentence" ) ,
14+ Configurator . Scanners . Humanize ( "PascalCaseInputStringIsTurnedIntoSentence" ) ,
1515 Is . EqualTo ( "Pascal case input string is turned into sentence" ) ) ;
1616 }
1717
@@ -37,32 +37,37 @@ public void WhenInputStringEndWithANumber_ThenNumberIsDealtWithLikeAWord()
3737 public void UnderscoredInputStringIsTurnedIntoSentence ( )
3838 {
3939 Assert . That (
40- Configurator . Scanners . Humanize ( "Underscored_input_string_is_turned_into_sentence" ) ,
40+ Configurator . Scanners . Humanize ( "Underscored_input_string_is_turned_into_sentence" ) ,
4141 Is . EqualTo ( "Underscored input string is turned into sentence" ) ) ;
4242 }
4343
4444 [ Test ]
4545 public void UnderscoredInputStringPreservesCasing ( )
4646 {
4747 Assert . That (
48- Configurator . Scanners . Humanize ( "Underscored_input_String_is_turned_INTO_sentence" ) ,
48+ Configurator . Scanners . Humanize ( "Underscored_input_String_is_turned_INTO_sentence" ) ,
4949 Is . EqualTo ( "Underscored input String is turned INTO sentence" ) ) ;
5050 }
5151
5252 [ Test ]
5353 public void OneLetterWordInTheBeginningOfStringIsTurnedIntoAWord ( )
5454 {
55- Assert . That (
56- Configurator . Scanners . Humanize ( "XIsFirstPlayer" ) ,
57- Is . EqualTo ( "X is first player" ) ) ;
55+ Assert . That ( Configurator . Scanners . Humanize ( "XIsFirstPlayer" ) , Is . EqualTo ( "X is first player" ) ) ;
5856 }
5957
60- [ Test ]
61- public void CanDealWithExampleStepNames ( )
58+ [ TestCase ( "GivenThereAre__start__Cucumbers" , "Given there are <start> cucumbers" ) ]
59+ [ TestCase ( "Given_there_are__start__cucumbers" , "Given there are <start> cucumbers" ) ]
60+ [ TestCase ( "GivenMethodTaking__ExampleInt__" , "Given method taking <example int>" ) ]
61+ [ TestCase ( "Given_method_taking__ExampleInt__" , "Given method taking <ExampleInt>" ) ]
62+ [ TestCase ( "__starting__with_example" , "<starting> with example" ) ]
63+ [ TestCase ( "__starting__WithExample" , "<starting> with example" ) ]
64+ [ TestCase ( "WhenMethod__takes____two__parameters" , "When method <takes> <two> parameters" ) ]
65+ [ TestCase ( "When_method__takes____two__parameters" , "When method <takes> <two> parameters" ) ]
66+ [ TestCase ( "When_method_takes__one__and__two__parameters" , "When method takes <one> and <two> parameters" ) ]
67+ [ TestCase ( "WhenMethodTakes__one__and__two__parameters" , "When method takes <one> and <two> parameters" ) ]
68+ public void CanDealWithExampleStepNames ( string stepName , string expectedStepTitle )
6269 {
63- NetToString . Convert ( "GivenThereAre__start__Cucumbers" ) . ShouldBe ( "Given there are <start> cucumbers" ) ;
64- NetToString . Convert ( "Given_there_are__start__cucumbers" ) . ShouldBe ( "Given there are <start> cucumbers" ) ;
65- NetToString . Convert ( "GivenMethodTaking__ExampleInt__" ) . ShouldBe ( "Given method taking <example int>" ) ;
70+ NetToString . Convert ( stepName ) . ShouldBe ( expectedStepTitle , Case . Sensitive ) ;
6671 }
6772 }
6873}
0 commit comments