@@ -182,12 +182,14 @@ public async Task MapNullablePropertiesWithInvalidValues() {
182182 topic . Attributes . SetValue ( "NullableInteger" , "A" ) ;
183183 topic . Attributes . SetValue ( "NullableBoolean" , "43" ) ;
184184 topic . Attributes . SetValue ( "NullableDateTime" , "Hello World" ) ;
185+ topic . Attributes . SetValue ( "NullableUrl" , "invalid://Web\\ Path\\ File!?@Query=String?" ) ;
185186
186187 var target = await mappingService . MapAsync < NullablePropertyTopicViewModel > ( topic ) . ConfigureAwait ( false ) ;
187188
188189 Assert . IsNull ( target . NullableInteger ) ;
189190 Assert . IsNull ( target . NullableBoolean ) ;
190191 Assert . IsNull ( target . NullableDateTime ) ;
192+ Assert . IsNull ( target . NullableUrl ) ;
191193
192194 //The following should not be null since they map to non-nullable properties which will have default values
193195 Assert . AreEqual ( topic . Title , target . Title ) ;
@@ -214,6 +216,7 @@ public async Task MapNullablePropertiesWithValidValues() {
214216 topic . Attributes . SetValue ( "NullableDouble" , "3.14159265359" ) ;
215217 topic . Attributes . SetValue ( "NullableBoolean" , "tRuE" ) ;
216218 topic . Attributes . SetValue ( "NullableDateTime" , "10/15/1976" ) ;
219+ topic . Attributes . SetValue ( "NullableUrl" , "/Web/Path/File?Query=String" ) ;
217220
218221 topic . Attributes . SetValue ( "Title" , "Hello World." ) ;
219222 topic . Attributes . SetValue ( "IsHidden" , "true" ) ;
@@ -226,6 +229,7 @@ public async Task MapNullablePropertiesWithValidValues() {
226229 Assert . AreEqual < double ? > ( 3.14159265359 , target . NullableDouble ) ;
227230 Assert . AreEqual < bool ? > ( true , target . NullableBoolean ) ;
228231 Assert . AreEqual < DateTime ? > ( new DateTime ( 1976 , 10 , 15 ) , target . NullableDateTime ) ;
232+ Assert . AreEqual < Uri ? > ( new Uri ( "/Web/Path/File?Query=String" , UriKind . RelativeOrAbsolute ) , target . NullableUrl ) ;
229233
230234 Assert . AreEqual < string ? > ( topic . Title , target . Title ) ;
231235 Assert . AreEqual < bool ? > ( target . IsHidden , target . IsHidden ) ;
0 commit comments