-Fixed WinRT build
This commit is contained in:
@@ -259,15 +259,15 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
string json = JsonConvert.SerializeObject(o, Formatting.Indented);
|
||||
|
||||
Assert.AreEqual(@"{
|
||||
""PositiveInfinity"": Infinity,
|
||||
""NegativeInfinity"": -Infinity,
|
||||
""PositiveInfinity"": ""Infinity"",
|
||||
""NegativeInfinity"": ""-Infinity"",
|
||||
""MinValue"": -1.7976931348623157E+308,
|
||||
""double"": 1.1,
|
||||
""int"": 1,
|
||||
""zero"": 0,
|
||||
""Epsilon"": 4.94065645841247E-324,
|
||||
""MaxValue"": 1.7976931348623157E+308,
|
||||
""NaN"": NaN,
|
||||
""NaN"": ""NaN"",
|
||||
""smallfraction"": 3.0000000000000009,
|
||||
""probablyint"": 1
|
||||
}", json);
|
||||
|
||||
@@ -1278,17 +1278,17 @@ bye", reader.Value);
|
||||
jsonReader.Read();
|
||||
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
|
||||
Assert.AreEqual(typeof(long), jsonReader.ValueType);
|
||||
Assert.AreEqual(250, jsonReader.Value);
|
||||
Assert.AreEqual((long)250, (long)jsonReader.Value);
|
||||
|
||||
jsonReader.Read();
|
||||
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
|
||||
Assert.AreEqual(typeof(long), jsonReader.ValueType);
|
||||
Assert.AreEqual(250, jsonReader.Value);
|
||||
Assert.AreEqual((long)250, (long)jsonReader.Value);
|
||||
|
||||
jsonReader.Read();
|
||||
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
|
||||
Assert.AreEqual(typeof(long), jsonReader.ValueType);
|
||||
Assert.AreEqual(250, jsonReader.Value);
|
||||
Assert.AreEqual((long)250, (long)jsonReader.Value);
|
||||
|
||||
Assert.IsTrue(jsonReader.Read());
|
||||
Assert.AreEqual(JsonToken.EndArray, jsonReader.TokenType);
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual(new Uri("http://www.google.com"), (Uri)(new JValue(new Uri("http://www.google.com"))));
|
||||
Assert.AreEqual(null, (Uri)(new JValue((object)null)));
|
||||
Assert.AreEqual(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi")), (string)(new JValue(Encoding.UTF8.GetBytes("hi"))));
|
||||
Assert.AreEqual(Encoding.UTF8.GetBytes("hi"), (byte[])(new JValue(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi")))));
|
||||
CollectionAssert.AreEquivalent((byte[])Encoding.UTF8.GetBytes("hi"), (byte[])(new JValue(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi")))));
|
||||
|
||||
Assert.AreEqual(null, (Uri)(JValue)null);
|
||||
Assert.AreEqual(null, (int?)(JValue)null);
|
||||
|
||||
@@ -562,7 +562,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
#if NETFX_CORE
|
||||
if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))
|
||||
contract.OnSerializingMethods = onSerializing;
|
||||
contract.OnSerializingMethods.AddRange(onSerializing);
|
||||
#else
|
||||
contract.OnSerializingMethods.AddRange(onSerializing);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user