-Fixed WinRT build

This commit is contained in:
James Newton-King
2013-03-04 14:35:58 +13:00
parent f9fa0b00e7
commit f42a6ca001
4 changed files with 8 additions and 8 deletions
@@ -259,15 +259,15 @@ namespace Newtonsoft.Json.Tests.Converters
string json = JsonConvert.SerializeObject(o, Formatting.Indented); string json = JsonConvert.SerializeObject(o, Formatting.Indented);
Assert.AreEqual(@"{ Assert.AreEqual(@"{
""PositiveInfinity"": Infinity, ""PositiveInfinity"": ""Infinity"",
""NegativeInfinity"": -Infinity, ""NegativeInfinity"": ""-Infinity"",
""MinValue"": -1.7976931348623157E+308, ""MinValue"": -1.7976931348623157E+308,
""double"": 1.1, ""double"": 1.1,
""int"": 1, ""int"": 1,
""zero"": 0, ""zero"": 0,
""Epsilon"": 4.94065645841247E-324, ""Epsilon"": 4.94065645841247E-324,
""MaxValue"": 1.7976931348623157E+308, ""MaxValue"": 1.7976931348623157E+308,
""NaN"": NaN, ""NaN"": ""NaN"",
""smallfraction"": 3.0000000000000009, ""smallfraction"": 3.0000000000000009,
""probablyint"": 1 ""probablyint"": 1
}", json); }", json);
@@ -1278,17 +1278,17 @@ bye", reader.Value);
jsonReader.Read(); jsonReader.Read();
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType); Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
Assert.AreEqual(typeof(long), jsonReader.ValueType); Assert.AreEqual(typeof(long), jsonReader.ValueType);
Assert.AreEqual(250, jsonReader.Value); Assert.AreEqual((long)250, (long)jsonReader.Value);
jsonReader.Read(); jsonReader.Read();
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType); Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
Assert.AreEqual(typeof(long), jsonReader.ValueType); Assert.AreEqual(typeof(long), jsonReader.ValueType);
Assert.AreEqual(250, jsonReader.Value); Assert.AreEqual((long)250, (long)jsonReader.Value);
jsonReader.Read(); jsonReader.Read();
Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType); Assert.AreEqual(JsonToken.Integer, jsonReader.TokenType);
Assert.AreEqual(typeof(long), jsonReader.ValueType); Assert.AreEqual(typeof(long), jsonReader.ValueType);
Assert.AreEqual(250, jsonReader.Value); Assert.AreEqual((long)250, (long)jsonReader.Value);
Assert.IsTrue(jsonReader.Read()); Assert.IsTrue(jsonReader.Read());
Assert.AreEqual(JsonToken.EndArray, jsonReader.TokenType); 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(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(null, (Uri)(new JValue((object)null)));
Assert.AreEqual(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi")), (string)(new JValue(Encoding.UTF8.GetBytes("hi")))); 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, (Uri)(JValue)null);
Assert.AreEqual(null, (int?)(JValue)null); Assert.AreEqual(null, (int?)(JValue)null);
@@ -562,7 +562,7 @@ namespace Newtonsoft.Json.Serialization
{ {
#if NETFX_CORE #if NETFX_CORE
if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))
contract.OnSerializingMethods = onSerializing; contract.OnSerializingMethods.AddRange(onSerializing);
#else #else
contract.OnSerializingMethods.AddRange(onSerializing); contract.OnSerializingMethods.AddRange(onSerializing);
#endif #endif