@@ -110,4 +110,96 @@ public void PropertyNamingPolicy_SnakeCase_FormattedCamelCase()
110110 // Assert
111111 act . Should ( ) . Be ( "prop_name.prop_value" ) ;
112112 }
113+
114+ [ Fact ( DisplayName = "Format to camel case null value - Should return empty" ) ]
115+ public void FormatPropertyToCamelCase_Null_Empty ( )
116+ {
117+ // Arrange
118+ string propertyName = null ;
119+
120+
121+ // Act
122+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
123+
124+
125+ // Assert
126+ act . Should ( ) . BeEmpty ( ) ;
127+ }
128+
129+ [ Fact ( DisplayName = "Format to camel case empty value - Should return empty" ) ]
130+ public void FormatPropertyToCamelCase_Empty_Empty ( )
131+ {
132+ // Arrange
133+ var propertyName = "" ;
134+
135+
136+ // Act
137+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
138+
139+
140+ // Assert
141+ act . Should ( ) . BeEmpty ( ) ;
142+ }
143+
144+ [ Fact ( DisplayName = "Format to camel case white spaces value - Should return empty" ) ]
145+ public void FormatPropertyToCamelCase_WhiteSpaces_Empty ( )
146+ {
147+ // Arrange
148+ var propertyName = " " ;
149+
150+
151+ // Act
152+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
153+
154+
155+ // Assert
156+ act . Should ( ) . BeEmpty ( ) ;
157+ }
158+
159+ [ Fact ( DisplayName = "Format to camel case white one character - Should return the character lowercase" ) ]
160+ public void FormatPropertyToCamelCase_OneCharacter_Lower ( )
161+ {
162+ // Arrange
163+ var propertyName = "G" ;
164+
165+
166+ // Act
167+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
168+
169+
170+ // Assert
171+ act . Should ( ) . Be ( "g" ) ;
172+ }
173+
174+ [ Fact ( DisplayName = "Format to camel case a text with only one dot - Should return a dot" ) ]
175+ public void FormatPropertyToCamelCase_OnlyOneDot_Dot ( )
176+ {
177+ // Arrange
178+ var propertyName = "." ;
179+
180+
181+ // Act
182+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
183+
184+
185+ // Assert
186+ act . Should ( ) . Be ( "." ) ;
187+ }
188+
189+
190+
191+ [ Fact ( DisplayName = "Format to camel case a text ended with an dot - Should format" ) ]
192+ public void FormatPropertyToCamelCase_EndWitDot_Format ( )
193+ {
194+ // Arrange
195+ var propertyName = "Hello." ;
196+
197+
198+ // Act
199+ var act = ObjectInvoker . Invoke < string > ( typeof ( ProblemDetailsFactory ) , "_formatPropertyToCamelCase" , propertyName ) ;
200+
201+
202+ // Assert
203+ act . Should ( ) . Be ( "hello." ) ;
204+ }
113205}
0 commit comments