@@ -12,6 +12,9 @@ public class StringCaseExtensionTests {
1212
1313 // Tests for ToCamelCase
1414 [ Test ]
15+ [ Arguments ( "" , "" ) ]
16+ [ Arguments ( null , null ) ]
17+ [ Arguments ( " " , " " ) ]
1518 [ Arguments ( "a" , "a" ) ]
1619 [ Arguments ( "A" , "a" ) ]
1720 [ Arguments ( "aA" , "aA" ) ]
@@ -30,18 +33,21 @@ public class StringCaseExtensionTests {
3033 [ Arguments ( "kebab-case" , "kebabCase" ) ]
3134 [ Arguments ( "kebab-case-with-numbers-123" , "kebabCaseWithNumbers123" ) ]
3235 [ Arguments ( "kebab-case-with-numbers-123-and-more" , "kebabCaseWithNumbers123AndMore" ) ]
33- public async Task ToCamelCase_ShouldWork ( string input , string expected ) {
36+ public async Task ToCamelCase_ShouldWork ( string ? input , string ? expected ) {
3437 // Arrange
3538
3639 // Act
37- var result = input . ToCamelCase ( ) ;
40+ string ? result = input ? . ToCamelCase ( ) ;
3841
3942 // Assert
4043 await Assert . That ( result ) . IsEqualTo ( expected ) ;
4144 }
4245
4346 // Tests for ToPascalCase
4447 [ Test ]
48+ [ Arguments ( "" , "" ) ]
49+ [ Arguments ( null , null ) ]
50+ [ Arguments ( " " , " " ) ]
4551 [ Arguments ( "a" , "A" ) ]
4652 [ Arguments ( "A" , "A" ) ]
4753 [ Arguments ( "aA" , "AA" ) ]
@@ -60,18 +66,21 @@ public async Task ToCamelCase_ShouldWork(string input, string expected) {
6066 [ Arguments ( "kebab-case" , "KebabCase" ) ]
6167 [ Arguments ( "kebab-case-with-numbers-123" , "KebabCaseWithNumbers123" ) ]
6268 [ Arguments ( "kebab-case-with-numbers-123-and-more" , "KebabCaseWithNumbers123AndMore" ) ]
63- public async Task ToPascalCase_ShouldWork ( string input , string expected ) {
69+ public async Task ToPascalCase_ShouldWork ( string ? input , string ? expected ) {
6470 // Arrange
6571
6672 // Act
67- var result = input . ToPascalCase ( ) ;
73+ string ? result = input ? . ToPascalCase ( ) ;
6874
6975 // Assert
7076 await Assert . That ( result ) . IsEqualTo ( expected ) ;
7177 }
7278
7379 // Tests for ToKebabCase
7480 [ Test ]
81+ [ Arguments ( "" , "" ) ]
82+ [ Arguments ( null , null ) ]
83+ [ Arguments ( " " , " " ) ]
7584 [ Arguments ( "a" , "a" ) ]
7685 [ Arguments ( "A" , "a" ) ]
7786 [ Arguments ( "aA" , "a-a" ) ]
@@ -90,18 +99,21 @@ public async Task ToPascalCase_ShouldWork(string input, string expected) {
9099 [ Arguments ( "kebab-case" , "kebab-case" ) ]
91100 [ Arguments ( "kebab-case-with-numbers-123" , "kebab-case-with-numbers-123" ) ]
92101 [ Arguments ( "kebab-case-with-numbers-123-and-more" , "kebab-case-with-numbers-123-and-more" ) ]
93- public async Task ToKebabCase_ShouldWork ( string input , string expected ) {
102+ public async Task ToKebabCase_ShouldWork ( string ? input , string ? expected ) {
94103 // Arrange
95104
96105 // Act
97- var result = input . ToKebabCase ( ) ;
106+ string ? result = input ? . ToKebabCase ( ) ;
98107
99108 // Assert
100109 await Assert . That ( result ) . IsEqualTo ( expected ) ;
101110 }
102111
103112 // Tests for ToSnakeCase
104113 [ Test ]
114+ [ Arguments ( "" , "" ) ]
115+ [ Arguments ( null , null ) ]
116+ [ Arguments ( " " , " " ) ]
105117 [ Arguments ( "a" , "a" ) ]
106118 [ Arguments ( "A" , "a" ) ]
107119 [ Arguments ( "aA" , "a_a" ) ]
@@ -120,18 +132,21 @@ public async Task ToKebabCase_ShouldWork(string input, string expected) {
120132 [ Arguments ( "kebab-case" , "kebab_case" ) ]
121133 [ Arguments ( "kebab-case-with-numbers-123" , "kebab_case_with_numbers_123" ) ]
122134 [ Arguments ( "kebab-case-with-numbers-123-and-more" , "kebab_case_with_numbers_123_and_more" ) ]
123- public async Task ToSnakeCase_ShouldWork ( string input , string expected ) {
135+ public async Task ToSnakeCase_ShouldWork ( string ? input , string ? expected ) {
124136 // Arrange
125137
126138 // Act
127- var result = input . ToSnakeCase ( ) ;
139+ string ? result = input ? . ToSnakeCase ( ) ;
128140
129141 // Assert
130142 await Assert . That ( result ) . IsEqualTo ( expected ) ;
131143 }
132144
133145 // Tests for ToPeriodSeparatedCase
134146 [ Test ]
147+ [ Arguments ( "" , "" ) ]
148+ [ Arguments ( null , null ) ]
149+ [ Arguments ( " " , " " ) ]
135150 [ Arguments ( "a" , "a" ) ]
136151 [ Arguments ( "A" , "a" ) ]
137152 [ Arguments ( "aA" , "a.a" ) ]
@@ -150,11 +165,11 @@ public async Task ToSnakeCase_ShouldWork(string input, string expected) {
150165 [ Arguments ( "kebab-case" , "kebab.case" ) ]
151166 [ Arguments ( "kebab-case-with-numbers-123" , "kebab.case.with.numbers.123" ) ]
152167 [ Arguments ( "kebab-case-with-numbers-123-and-more" , "kebab.case.with.numbers.123.and.more" ) ]
153- public async Task ToPeriodSeparatedCase_ShouldWork ( string input , string expected ) {
168+ public async Task ToPeriodSeparatedCase_ShouldWork ( string ? input , string ? expected ) {
154169 // Arrange
155170
156171 // Act
157- var result = input . ToPeriodSeparatedCase ( ) ;
172+ string ? result = input ? . ToPeriodSeparatedCase ( ) ;
158173
159174 // Assert
160175 await Assert . That ( result ) . IsEqualTo ( expected ) ;
0 commit comments