@@ -250,7 +250,7 @@ public void Test_ServiceStack_Text_JsonSerializer_Array_Value_Deserializes_Corre
250250 }
251251
252252 [ Test ]
253- public void deserizes_to_decimal_by_default ( )
253+ public void Deserializes_to_decimal_by_default ( )
254254 {
255255 JsConfig . TryToParsePrimitiveTypeValues = true ;
256256
@@ -279,7 +279,7 @@ public NumericType(decimal min, decimal max, Type type)
279279 }
280280
281281 [ Test ]
282- public void deserizes_signed_bytes_into_to_best_fit_numeric ( )
282+ public void Deserializes_signed_bytes_into_to_best_fit_numeric ( )
283283 {
284284 JsConfig . TryToParsePrimitiveTypeValues = true ;
285285 JsConfig . TryToParseNumericType = true ;
@@ -292,16 +292,18 @@ public void deserizes_signed_bytes_into_to_best_fit_numeric()
292292 Assert . That ( deserializedDict [ "max" ] , Is . EqualTo ( sbyte . MaxValue ) ) ;
293293 }
294294
295+ #if NETFX
295296 [ Test ]
296- public void deserizes_floats_into_to_best_fit_floating_point ( )
297+ public void Deserializes_floats_into_to_best_fit_floating_point ( )
297298 {
298299 JsConfig . TryToParsePrimitiveTypeValues = true ;
299300 JsConfig . TryToParseNumericType = true ;
300301 JsConfig . ParsePrimitiveFloatingPointTypes = ParseAsType . Single | ParseAsType . Double ;
301302
302303 float floatValue = 1.1f ;
303304 //TODO find a number that doesn't suck which throws in float.Parse() but not double.Parse()
304- double doubleValue = double . MaxValue - Math . Pow ( 2 , 1000 ) ;
305+ double Offset = Math . Pow ( 2 , 1000 ) ;
306+ double doubleValue = double . MaxValue - Offset ;
305307 var intValue = int . MaxValue ;
306308 var longValue = long . MaxValue ;
307309
@@ -311,17 +313,17 @@ public void deserizes_floats_into_to_best_fit_floating_point()
311313 var toFloatValue = float . Parse ( floatValue . ToString ( ) ) ;
312314 Assert . AreEqual ( toFloatValue , floatValue , 1 ) ;
313315 var toDoubleValue = double . Parse ( doubleValue . ToString ( ) ) ;
314- Assert . AreEqual ( toDoubleValue , doubleValue , Math . Pow ( 2 , 1000 ) ) ;
316+ Assert . AreEqual ( toDoubleValue , doubleValue , Offset ) ;
315317
316318 var json = "{{\" float\" :{0},\" double\" :{1},\" int\" :{2},\" long\" :{3}}}"
317319 . Fmt ( CultureInfo . InvariantCulture , floatValue , doubleValue , intValue , longValue ) ;
318320 var map = JsonSerializer . DeserializeFromString < IDictionary < string , object > > ( json ) ;
319321
320322 Assert . That ( map [ "float" ] , Is . TypeOf < float > ( ) ) ;
321323 Assert . That ( map [ "float" ] , Is . EqualTo ( floatValue ) ) ;
322-
324+
323325 Assert . That ( map [ "double" ] , Is . TypeOf < double > ( ) ) ;
324- Assert . AreEqual ( ( double ) map [ "double" ] , doubleValue , Math . Pow ( 2 , 1000 ) ) ;
326+ Assert . AreEqual ( ( double ) map [ "double" ] , doubleValue , Offset ) ;
325327
326328 Assert . That ( map [ "int" ] , Is . TypeOf < int > ( ) ) ;
327329 Assert . That ( map [ "int" ] , Is . EqualTo ( intValue ) ) ;
@@ -331,9 +333,10 @@ public void deserizes_floats_into_to_best_fit_floating_point()
331333
332334 JsConfig . Reset ( ) ;
333335 }
336+ #endif
334337
335338 [ Test ]
336- public void deserizes_signed_types_into_to_best_fit_numeric ( )
339+ public void Deserializes_signed_types_into_to_best_fit_numeric ( )
337340 {
338341 var unsignedTypes = new [ ]
339342 {
@@ -365,7 +368,7 @@ public void deserizes_signed_types_into_to_best_fit_numeric()
365368 }
366369
367370 [ Test ]
368- public void deserizes_unsigned_types_into_to_best_fit_numeric ( )
371+ public void Deserializes_unsigned_types_into_to_best_fit_numeric ( )
369372 {
370373 var unsignedTypes = new [ ]
371374 {
0 commit comments