-Cleaned up preprocessor symbols

This commit is contained in:
James Newton-King
2017-03-05 15:12:52 +13:00
parent febdb8188b
commit ba514c4610
85 changed files with 226 additions and 235 deletions
@@ -24,7 +24,7 @@
#endregion #endregion
#pragma warning disable 618 #pragma warning disable 618
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@@ -31,7 +31,7 @@ using System.Reflection;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Tests.TestObjects; using Newtonsoft.Json.Tests.TestObjects;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -1491,7 +1491,7 @@ namespace Newtonsoft.Json.Tests.Bson
Assert.AreEqual(badText, (string)o["test"]); Assert.AreEqual(badText, (string)o["test"]);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
public class BigIntegerTestClass public class BigIntegerTestClass
{ {
public BigInteger Blah { get; set; } public BigInteger Blah { get; set; }
@@ -24,9 +24,9 @@
#endregion #endregion
#pragma warning disable 618 #pragma warning disable 618
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -499,7 +499,7 @@ namespace Newtonsoft.Json.Tests.Bson
Assert.AreEqual("10-00-00-00-09-30-00-C8-88-07-6B-DC-00-00-00-00", (BitConverter.ToString(ms.ToArray()))); Assert.AreEqual("10-00-00-00-09-30-00-C8-88-07-6B-DC-00-00-00-00", (BitConverter.ToString(ms.ToArray())));
} }
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task WriteBigIntegerAsync() public async Task WriteBigIntegerAsync()
{ {
@@ -26,7 +26,7 @@
#pragma warning disable 618 #pragma warning disable 618
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -798,7 +798,7 @@ namespace Newtonsoft.Json.Tests.Bson
Assert.AreEqual(c.AGuid, c2.AGuid.ToString()); Assert.AreEqual(c.AGuid, c2.AGuid.ToString());
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void WriteBigInteger() public void WriteBigInteger()
{ {
@@ -55,7 +55,7 @@ namespace Newtonsoft.Json.Tests.Converters
public byte[] NullByteArray { get; set; } public byte[] NullByteArray { get; set; }
} }
#if !(NET20 || PORTABLE || PORTABLE40 || DNXCORE50) #if !(NET20 || PORTABLE || DNXCORE50)
[Test] [Test]
public void DeserializeBinaryClass() public void DeserializeBinaryClass()
{ {
@@ -121,7 +121,7 @@ namespace Newtonsoft.Json.Tests.Converters
}", json); }", json);
} }
#if !(PORTABLE || PORTABLE40 || DNXCORE50) #if !(PORTABLE || DNXCORE50)
public class SqlBinaryClass public class SqlBinaryClass
{ {
public SqlBinary SqlBinary { get; set; } public SqlBinary SqlBinary { get; set; }
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
using System; using System;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if DNXCORE50 #if DNXCORE50
@@ -28,7 +28,7 @@ using System.Text;
using Newtonsoft.Json.Bson; using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if DNXCORE50 #if DNXCORE50
@@ -486,7 +486,7 @@ namespace Newtonsoft.Json.Tests.Converters
StringAssert.AreEqual(@"null", json); StringAssert.AreEqual(@"null", json);
} }
#if !(NET20 || PORTABLE || PORTABLE40) #if !(NET20 || PORTABLE)
[Test] [Test]
public void DeserializedTypedDataTableWithConverter() public void DeserializedTypedDataTableWithConverter()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Dynamic; using System.Dynamic;
@@ -30,7 +30,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
using System.Linq; using System.Linq;
#endif #endif
using System.Text; using System.Text;
#if !(DNXCORE50 || PORTABLE40) #if !(DNXCORE50)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json.Tests.Serialization; using Newtonsoft.Json.Tests.Serialization;
@@ -2698,7 +2698,7 @@ namespace Newtonsoft.Json.Tests.Converters
Assert.AreEqual(@"<root><b xmlns=""http://www.example.com/ns"">Asd</b><c>AAA</c><test>adad</test></root>", xmlBack.OuterXml); Assert.AreEqual(@"<root><b xmlns=""http://www.example.com/ns"">Asd</b><c>AAA</c><test>adad</test></root>", xmlBack.OuterXml);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void DeserializeBigInteger() public void DeserializeBigInteger()
{ {
+3 -3
View File
@@ -24,7 +24,7 @@
#endregion #endregion
using System; using System;
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40 || DNXCORE50) #if !(NET20 || NET35 || NET40 || PORTABLE || DNXCORE50)
using System.Buffers; using System.Buffers;
#endif #endif
using System.Collections.Generic; using System.Collections.Generic;
@@ -589,7 +589,7 @@ namespace Newtonsoft.Json.Tests
}", json); }", json);
} }
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40 || DNXCORE50) #if !(NET20 || NET35 || NET40 || PORTABLE || DNXCORE50)
[Test] [Test]
public void ArrayPooling() public void ArrayPooling()
{ {
@@ -608,7 +608,7 @@ namespace Newtonsoft.Json.Tests
#endif #endif
} }
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40 || DNXCORE50) #if !(NET20 || NET35 || NET40 || PORTABLE || DNXCORE50)
public class JsonArrayPool : IArrayPool<char> public class JsonArrayPool : IArrayPool<char>
{ {
public static readonly JsonArrayPool Instance = new JsonArrayPool(); public static readonly JsonArrayPool Instance = new JsonArrayPool();
+3 -3
View File
@@ -28,7 +28,7 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
@@ -607,7 +607,7 @@ namespace Newtonsoft.Json.Tests
value = null; value = null;
Assert.AreEqual("null", JsonConvert.ToString(value)); Assert.AreEqual("null", JsonConvert.ToString(value));
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
value = DBNull.Value; value = DBNull.Value;
Assert.AreEqual("null", JsonConvert.ToString(value)); Assert.AreEqual("null", JsonConvert.ToString(value));
#endif #endif
@@ -1109,7 +1109,7 @@ namespace Newtonsoft.Json.Tests
writer.Flush(); writer.Flush();
} }
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void IntegerLengthOverflows() public void IntegerLengthOverflows()
{ {
@@ -23,11 +23,11 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Globalization; using System.Globalization;
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -593,7 +593,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
} }
} }
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task ReadInt64OverflowAsync() public async Task ReadInt64OverflowAsync()
{ {
@@ -28,7 +28,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -616,7 +616,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
} }
} }
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ReadInt64Overflow() public void ReadInt64Overflow()
{ {
@@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
} }
#endif #endif
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ReadInt64Overflow_Negative() public void ReadInt64Overflow_Negative()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
#if DNXCORE50 #if DNXCORE50
@@ -28,7 +28,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Globalization; using System.Globalization;
@@ -28,7 +28,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Text; using System.Text;
@@ -28,7 +28,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -23,12 +23,12 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -56,7 +56,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
#endif #endif
public class ReadAsyncTests : TestFixtureBase public class ReadAsyncTests : TestFixtureBase
{ {
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) #if !(PORTABLE || NET35 || NET20)
[Test] [Test]
public async Task ReadAsBooleanAsync() public async Task ReadAsBooleanAsync()
{ {
@@ -1173,7 +1173,7 @@ second line
third line", jsonTextReader.Value); third line", jsonTextReader.Value);
} }
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task ReadBigIntegerAsync() public async Task ReadBigIntegerAsync()
{ {
@@ -28,7 +28,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
#endif #endif
public class ReadTests : TestFixtureBase public class ReadTests : TestFixtureBase
{ {
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) #if !(PORTABLE || NET35 || NET20)
[Test] [Test]
public void ReadAsBoolean() public void ReadAsBoolean()
{ {
@@ -1194,7 +1194,7 @@ third line", jsonTextReader.Value);
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ReadBigInteger() public void ReadBigInteger()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -134,7 +134,7 @@ namespace Newtonsoft.Json.Tests
Assert.AreEqual(1, arrayPool.FreeArrays.Count); Assert.AreEqual(1, arrayPool.FreeArrays.Count);
} }
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40 || DNXCORE50) #if !(NET20 || NET35 || NET40 || PORTABLE || DNXCORE50)
[Test] [Test]
public void BufferErroringWithInvalidSize() public void BufferErroringWithInvalidSize()
{ {
@@ -30,7 +30,7 @@ using System.IO;
#if NET20 #if NET20
using Newtonsoft.Json.Utilities.LinqBridge; using Newtonsoft.Json.Utilities.LinqBridge;
#endif #endif
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -353,7 +353,7 @@ namespace Newtonsoft.Json.Tests
Assert.IsNotNull(validationEventArgs); Assert.IsNotNull(validationEventArgs);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void IntegerGreaterThanMaximumValue_BigInteger() public void IntegerGreaterThanMaximumValue_BigInteger()
{ {
@@ -606,7 +606,7 @@ namespace Newtonsoft.Json.Tests
Assert.IsNotNull(validationEventArgs); Assert.IsNotNull(validationEventArgs);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void BigIntegerDivisibleBy_Success() public void BigIntegerDivisibleBy_Success()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE || PORTABLE40 || DNXCORE50) #if !(PORTABLE || DNXCORE50)
using NUnit.Framework; using NUnit.Framework;
using System.Web.UI; using System.Web.UI;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE || PORTABLE40 || DNXCORE50) #if !(PORTABLE || DNXCORE50)
using NUnit.Framework; using NUnit.Framework;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
+14 -14
View File
@@ -24,12 +24,12 @@
#endregion #endregion
using System.Diagnostics; using System.Diagnostics;
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Dynamic; using System.Dynamic;
using System.Linq; using System.Linq;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -257,7 +257,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
, new JProperty("BigInteger", BigInteger.Parse("1")) , new JProperty("BigInteger", BigInteger.Parse("1"))
#endif #endif
); );
@@ -290,7 +290,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(d.Decimal == 1.1m); Assert.IsTrue(d.Decimal == 1.1m);
Assert.IsTrue(d.Decimal != 1.0f); Assert.IsTrue(d.Decimal != 1.0f);
Assert.IsTrue(d.Decimal != 1.0d); Assert.IsTrue(d.Decimal != 1.0d);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
Assert.IsTrue(d.Decimal > new BigInteger(0)); Assert.IsTrue(d.Decimal > new BigInteger(0));
#endif #endif
@@ -306,11 +306,11 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(d.Float == 1.1m); Assert.IsTrue(d.Float == 1.1m);
Assert.IsTrue(d.Float != 1.0f); Assert.IsTrue(d.Float != 1.0f);
Assert.IsTrue(d.Float != 1.0d); Assert.IsTrue(d.Float != 1.0d);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
Assert.IsTrue(d.Float > new BigInteger(0)); Assert.IsTrue(d.Float > new BigInteger(0));
#endif #endif
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
Assert.IsTrue(d.BigInteger == d.BigInteger); Assert.IsTrue(d.BigInteger == d.BigInteger);
Assert.IsTrue(d.BigInteger > 0); Assert.IsTrue(d.BigInteger > 0);
Assert.IsTrue(d.BigInteger > 0.0m); Assert.IsTrue(d.BigInteger > 0.0m);
@@ -366,7 +366,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
, new JProperty("BigInteger", new BigInteger(100)) , new JProperty("BigInteger", new BigInteger(100))
#endif #endif
); );
@@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Tests.Linq
r += 2; r += 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
r = d.BigInteger + null; r = d.BigInteger + null;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
r += 2; r += 2;
@@ -524,7 +524,7 @@ namespace Newtonsoft.Json.Tests.Linq
r -= 2; r -= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
r = d.BigInteger - null; r = d.BigInteger - null;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
r -= 2; r -= 2;
@@ -598,7 +598,7 @@ namespace Newtonsoft.Json.Tests.Linq
r *= 2; r *= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
r = d.BigInteger * 1.1d; r = d.BigInteger * 1.1d;
Assert.AreEqual(100m, (decimal)r); Assert.AreEqual(100m, (decimal)r);
r *= 2; r *= 2;
@@ -672,7 +672,7 @@ namespace Newtonsoft.Json.Tests.Linq
r /= 2; r /= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
r = d.BigInteger / 1.1d; r = d.BigInteger / 1.1d;
Assert.AreEqual(100m, (decimal)r); Assert.AreEqual(100m, (decimal)r);
r /= 2; r /= 2;
@@ -700,7 +700,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
, new JProperty("BigInteger", new BigInteger(100)) , new JProperty("BigInteger", new BigInteger(100))
#endif #endif
); );
@@ -717,7 +717,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString()); Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString());
Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString()); Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString());
Assert.AreEqual("1.00:00:00", d.TimeSpan.ToString()); Assert.AreEqual("1.00:00:00", d.TimeSpan.ToString());
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
Assert.AreEqual("100", d.BigInteger.ToString()); Assert.AreEqual("100", d.BigInteger.ToString());
#endif #endif
} }
@@ -801,7 +801,7 @@ namespace Newtonsoft.Json.Tests.Linq
AssertValueConverted<Guid?>(null); AssertValueConverted<Guid?>(null);
AssertValueConverted<Uri>(new Uri("http://json.codeplex.com/")); AssertValueConverted<Uri>(new Uri("http://json.codeplex.com/"));
AssertValueConverted<Uri>(null); AssertValueConverted<Uri>(null);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
AssertValueConverted<BigInteger>(new BigInteger(100)); AssertValueConverted<BigInteger>(new BigInteger(100));
AssertValueConverted<BigInteger?>(null); AssertValueConverted<BigInteger?>(null);
#endif #endif
@@ -431,7 +431,7 @@ Parameter name: index");
} }
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void ITypedListGetItemProperties() public void ITypedListGetItemProperties()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50 #if DNXCORE50
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json.Tests.TestObjects; using Newtonsoft.Json.Tests.TestObjects;
@@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture] [TestFixture]
public class JObjectTests : TestFixtureBase public class JObjectTests : TestFixtureBase
{ {
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void EmbedJValueStringInNewJObject() public void EmbedJValueStringInNewJObject()
{ {
@@ -716,7 +716,7 @@ Parameter name: arrayIndex");
Assert.AreEqual(p4, l[1]); Assert.AreEqual(p4, l[1]);
} }
#if !(NET20 || PORTABLE || PORTABLE40) #if !(NET20 || PORTABLE)
[Test] [Test]
public void PropertyChanging() public void PropertyChanging()
{ {
@@ -1259,7 +1259,7 @@ Parameter name: arrayIndex");
}, "Can not add property Test3 to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object."); }, "Can not add property Test3 to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.");
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void IBindingListSortDirection() public void IBindingListSortDirection()
{ {
@@ -1454,7 +1454,7 @@ Parameter name: arrayIndex");
} }
#endif #endif
#if !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35)
[Test] [Test]
public void CollectionChanged() public void CollectionChanged()
{ {
@@ -1583,7 +1583,7 @@ Parameter name: arrayIndex");
Assert.AreEqual("Name2", value); Assert.AreEqual("Name2", value);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void WriteObjectNullDBNullValue() public void WriteObjectNullDBNullValue()
{ {
@@ -1695,7 +1695,7 @@ Parameter name: arrayIndex");
}, "Unexpected end of content while loading JObject. Path 'short.error.code', line 6, position 14."); }, "Unexpected end of content while loading JObject. Path 'short.error.code', line 6, position 14.");
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void GetProperties() public void GetProperties()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50 #if DNXCORE50
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(p, p.Value.Parent); Assert.AreEqual(p, p.Value.Parent);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void ListChanged() public void ListChanged()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Text; using System.Text;
@@ -36,7 +36,7 @@ using Assert = Newtonsoft.Json.Tests.XUnitAssert;
using NUnit.Framework; using NUnit.Framework;
#endif #endif
using System.IO; using System.IO;
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -48,7 +48,7 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture] [TestFixture]
public class JTokenReaderAsyncTests : TestFixtureBase public class JTokenReaderAsyncTests : TestFixtureBase
{ {
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task ConvertBigIntegerToDoubleAsync() public async Task ConvertBigIntegerToDoubleAsync()
{ {
@@ -757,7 +757,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(1d, await reader.ReadAsDoubleAsync()); Assert.AreEqual(1d, await reader.ReadAsDoubleAsync());
} }
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task ReadAsBoolean_BigInteger_SuccessAsync() public async Task ReadAsBoolean_BigInteger_SuccessAsync()
{ {
@@ -35,7 +35,7 @@ using NUnit.Framework;
#endif #endif
using Newtonsoft.Json; using Newtonsoft.Json;
using System.IO; using System.IO;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -47,7 +47,7 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture] [TestFixture]
public class JTokenReaderTest : TestFixtureBase public class JTokenReaderTest : TestFixtureBase
{ {
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ConvertBigIntegerToDouble() public void ConvertBigIntegerToDouble()
{ {
@@ -872,7 +872,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(1d, reader.ReadAsDouble()); Assert.AreEqual(1d, reader.ReadAsDouble());
} }
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ReadAsBoolean_BigInteger_Success() public void ReadAsBoolean_BigInteger_Success()
{ {
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -369,7 +369,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase))); Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase)));
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990"; string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990";
Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value); Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value);
@@ -449,7 +449,7 @@ namespace Newtonsoft.Json.Tests.Linq
#endif #endif
ExceptionAssert.Throws<ArgumentException>(() => { var i = (Uri)new JValue(true); }, "Can not convert Boolean to Uri."); ExceptionAssert.Throws<ArgumentException>(() => { var i = (Uri)new JValue(true); }, "Can not convert Boolean to Uri.");
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
ExceptionAssert.Throws<ArgumentException>(() => { var i = (new JValue(new Uri("http://www.google.com"))).ToObject<BigInteger>(); }, "Can not convert Uri to BigInteger."); ExceptionAssert.Throws<ArgumentException>(() => { var i = (new JValue(new Uri("http://www.google.com"))).ToObject<BigInteger>(); }, "Can not convert Uri to BigInteger.");
ExceptionAssert.Throws<ArgumentException>(() => { var i = (JValue.CreateNull()).ToObject<BigInteger>(); }, "Can not convert Null to BigInteger."); ExceptionAssert.Throws<ArgumentException>(() => { var i = (JValue.CreateNull()).ToObject<BigInteger>(); }, "Can not convert Null to BigInteger.");
ExceptionAssert.Throws<ArgumentException>(() => { var i = (new JValue(Guid.NewGuid())).ToObject<BigInteger>(); }, "Can not convert Guid to BigInteger."); ExceptionAssert.Throws<ArgumentException>(() => { var i = (new JValue(Guid.NewGuid())).ToObject<BigInteger>(); }, "Can not convert Guid to BigInteger.");
@@ -466,7 +466,7 @@ namespace Newtonsoft.Json.Tests.Linq
[Test] [Test]
public void ToObject() public void ToObject()
{ {
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger)))); Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger))));
Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger?)))); Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger?))));
Assert.AreEqual((BigInteger?)null, (JValue.CreateNull().ToObject(typeof(BigInteger?)))); Assert.AreEqual((BigInteger?)null, (JValue.CreateNull().ToObject(typeof(BigInteger?))));
@@ -524,7 +524,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(JToken.DeepEquals(new JValue((DateTimeOffset?)null), (JValue)(DateTimeOffset?)null)); Assert.IsTrue(JToken.DeepEquals(new JValue((DateTimeOffset?)null), (JValue)(DateTimeOffset?)null));
#endif #endif
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
// had to remove implicit casting to avoid user reference to System.Numerics.dll // had to remove implicit casting to avoid user reference to System.Numerics.dll
Assert.IsTrue(JToken.DeepEquals(new JValue(new BigInteger(1)), new JValue(new BigInteger(1)))); Assert.IsTrue(JToken.DeepEquals(new JValue(new BigInteger(1)), new JValue(new BigInteger(1))));
Assert.IsTrue(JToken.DeepEquals(new JValue((BigInteger?)null), new JValue((BigInteger?)null))); Assert.IsTrue(JToken.DeepEquals(new JValue((BigInteger?)null), new JValue((BigInteger?)null)));
@@ -1147,7 +1147,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(a.DeepEquals(a2)); Assert.IsTrue(a.DeepEquals(a2));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void Clone() public void Clone()
{ {
@@ -23,10 +23,10 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -115,7 +115,7 @@ namespace Newtonsoft.Json.Tests.Linq
await jsonWriter.WriteValueAsync("DVD read/writer"); await jsonWriter.WriteValueAsync("DVD read/writer");
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
await jsonWriter.WriteValueAsync(new BigInteger(123)); await jsonWriter.WriteValueAsync(new BigInteger(123));
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#endif #endif
@@ -167,7 +167,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken); Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken);
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
await jsonWriter.WriteValueAsync(new BigInteger(123)); await jsonWriter.WriteValueAsync(new BigInteger(123));
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken); Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken);
@@ -200,7 +200,7 @@ namespace Newtonsoft.Json.Tests.Linq
/*fail*/]", writer.Token.ToString()); /*fail*/]", writer.Token.ToString());
} }
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public async Task WriteBigIntegerAsync() public async Task WriteBigIntegerAsync()
{ {
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -120,7 +120,7 @@ namespace Newtonsoft.Json.Tests.Linq
jsonWriter.WriteValue("DVD read/writer"); jsonWriter.WriteValue("DVD read/writer");
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
jsonWriter.WriteValue(new BigInteger(123)); jsonWriter.WriteValue(new BigInteger(123));
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#endif #endif
@@ -172,7 +172,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken); Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken);
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
jsonWriter.WriteValue(new BigInteger(123)); jsonWriter.WriteValue(new BigInteger(123));
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken); Assert.AreEqual(a[a.Count - 1], jsonWriter.CurrentToken);
@@ -205,7 +205,7 @@ namespace Newtonsoft.Json.Tests.Linq
/*fail*/]", writer.Token.ToString()); /*fail*/]", writer.Token.ToString());
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void WriteBigInteger() public void WriteBigInteger()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.IO; using System.IO;
+11 -11
View File
@@ -28,7 +28,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Tests.TestObjects; using Newtonsoft.Json.Tests.TestObjects;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -150,7 +150,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("Pie", v.Value); Assert.AreEqual("Pie", v.Value);
Assert.AreEqual(JTokenType.String, v.Type); Assert.AreEqual(JTokenType.String, v.Type);
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
v.Value = DBNull.Value; v.Value = DBNull.Value;
Assert.AreEqual(DBNull.Value, v.Value); Assert.AreEqual(DBNull.Value, v.Value);
Assert.AreEqual(JTokenType.Null, v.Type); Assert.AreEqual(JTokenType.Null, v.Type);
@@ -179,7 +179,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(g, v.Value); Assert.AreEqual(g, v.Value);
Assert.AreEqual(JTokenType.Guid, v.Type); Assert.AreEqual(JTokenType.Guid, v.Type);
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"); BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990");
v.Value = i; v.Value = i;
Assert.AreEqual(i, v.Value); Assert.AreEqual(i, v.Value);
@@ -239,13 +239,13 @@ namespace Newtonsoft.Json.Tests.Linq
v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5")); v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5"));
Assert.AreEqual("b282ade7-c520-496c-a448-4084f6803de5", v.ToString(null, CultureInfo.InvariantCulture)); Assert.AreEqual("b282ade7-c520-496c-a448-4084f6803de5", v.ToString(null, CultureInfo.InvariantCulture));
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
v = new JValue(BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990")); v = new JValue(BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"));
Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture)); Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture));
#endif #endif
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void JValueParse() public void JValueParse()
{ {
@@ -513,7 +513,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue))); Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue)));
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ConvertsToInt32_BigInteger() public void ConvertsToInt32_BigInteger()
{ {
@@ -641,7 +641,7 @@ namespace Newtonsoft.Json.Tests.Linq
} }
#endif #endif
#if !(PORTABLE40 || NET35 || NET20) #if !(NET35 || NET20)
[Test] [Test]
public void ExpicitConversionTest() public void ExpicitConversionTest()
{ {
@@ -675,7 +675,7 @@ namespace Newtonsoft.Json.Tests.Linq
v = new JValue(new Uri("http://www.google.com")); v = new JValue(new Uri("http://www.google.com"));
Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
v = new JValue(new BigInteger(3)); v = new JValue(new BigInteger(3));
Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
#endif #endif
@@ -694,7 +694,7 @@ namespace Newtonsoft.Json.Tests.Linq
int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture); int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture);
Assert.AreEqual(9, i); Assert.AreEqual(9, i);
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture); BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture);
Assert.AreEqual(new BigInteger(9), bi); Assert.AreEqual(new BigInteger(9), bi);
#endif #endif
@@ -709,7 +709,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("2013", v.ToString("yyyy")); Assert.AreEqual("2013", v.ToString("yyyy"));
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ToStringNewTypes() public void ToStringNewTypes()
{ {
@@ -796,7 +796,7 @@ namespace Newtonsoft.Json.Tests.Linq
}", json); }", json);
} }
#if !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35)
[Test] [Test]
public void EnumTests() public void EnumTests()
{ {
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) || NETSTANDARD1_1 #if !(PORTABLE || NET35 || NET20) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Linq.JsonPath; using Newtonsoft.Json.Linq.JsonPath;
@@ -738,7 +738,7 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
Assert.IsTrue(JToken.DeepEquals(new JObject(new JProperty("hi", 3)), t[1])); Assert.IsTrue(JToken.DeepEquals(new JObject(new JProperty("hi", 3)), t[1]));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40 || NET35 || NET20) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50 || NET35 || NET20) || NETSTANDARD1_3
[Test] [Test]
public void GreaterQueryBigInteger() public void GreaterQueryBigInteger()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -1185,7 +1185,7 @@ keyword such as type of business.""
Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d); Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d);
} }
#if !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35)
[Test] [Test]
public void CovariantIJEnumerable() public void CovariantIJEnumerable()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(DNXCORE50 || PORTABLE40 || PORTABLE40 || NET20) #if !(DNXCORE50 || NET20)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@@ -113,6 +113,6 @@
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp1.0'"> <PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp1.0'">
<DefineConstants>NETSTANDARD1_1;DNXCORE50;PORTABLE;$(AdditionalConstants)</DefineConstants> <DefineConstants>NETSTANDARD1_3;DNXCORE50;PORTABLE;$(AdditionalConstants)</DefineConstants>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
@@ -33,10 +33,8 @@ using System.Security;
#if NETSTANDARD1_0 #if NETSTANDARD1_0
[assembly: AssemblyTitle("Json.NET Tests .NET Standard 1.0")] [assembly: AssemblyTitle("Json.NET Tests .NET Standard 1.0")]
#elif NETSTANDARD1_1 #elif NETSTANDARD1_3
[assembly: AssemblyTitle("Json.NET Tests .NET Standard 1.1")] [assembly: AssemblyTitle("Json.NET Tests .NET Standard 1.3")]
#elif PORTABLE40
[assembly: AssemblyTitle("Json.NET Tests Portable .NET 4.0")]
#elif PORTABLE #elif PORTABLE
[assembly: AssemblyTitle("Json.NET Tests Portable")] [assembly: AssemblyTitle("Json.NET Tests Portable")]
#elif NET20 #elif NET20
@@ -204,7 +204,7 @@ namespace Newtonsoft.Json.Tests.Schema
#if !NET20 #if !NET20
GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass()); GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass());
#endif #endif
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
GenerateSchemaAndSerializeFromType(new DataSet()); GenerateSchemaAndSerializeFromType(new DataSet());
#endif #endif
GenerateSchemaAndSerializeFromType(new object()); GenerateSchemaAndSerializeFromType(new object());
@@ -212,7 +212,7 @@ namespace Newtonsoft.Json.Tests.Schema
GenerateSchemaAndSerializeFromType("Hi"); GenerateSchemaAndSerializeFromType("Hi");
GenerateSchemaAndSerializeFromType(new DateTime(2000, 12, 29, 23, 59, 0, DateTimeKind.Utc)); GenerateSchemaAndSerializeFromType(new DateTime(2000, 12, 29, 23, 59, 0, DateTimeKind.Utc));
GenerateSchemaAndSerializeFromType(TimeSpan.FromTicks(1000000)); GenerateSchemaAndSerializeFromType(TimeSpan.FromTicks(1000000));
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
GenerateSchemaAndSerializeFromType(DBNull.Value); GenerateSchemaAndSerializeFromType(DBNull.Value);
#endif #endif
GenerateSchemaAndSerializeFromType(new JsonPropertyWithHandlingValues()); GenerateSchemaAndSerializeFromType(new JsonPropertyWithHandlingValues());
@@ -93,7 +93,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(o.IsValid(schema)); Assert.IsTrue(o.IsValid(schema));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void Generate_DefaultValueAttributeTestClass() public void Generate_DefaultValueAttributeTestClass()
{ {
@@ -312,7 +312,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(v.IsValid(schema)); Assert.IsTrue(v.IsValid(schema));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test] [Test]
public void GenerateSchemaForISerializable() public void GenerateSchemaForISerializable()
{ {
@@ -327,7 +327,7 @@ namespace Newtonsoft.Json.Tests.Schema
} }
#endif #endif
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void GenerateSchemaForDBNull() public void GenerateSchemaForDBNull()
{ {
@@ -340,7 +340,7 @@ namespace Newtonsoft.Json.Tests.Schema
} }
#endif #endif
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
public class CustomDirectoryInfoMapper : DefaultContractResolver public class CustomDirectoryInfoMapper : DefaultContractResolver
{ {
public CustomDirectoryInfoMapper() public CustomDirectoryInfoMapper()
@@ -479,7 +479,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName; generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CamelCasePropertyNamesContractResolver() generator.ContractResolver = new CamelCasePropertyNamesContractResolver()
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
}; };
@@ -524,7 +524,7 @@ namespace Newtonsoft.Json.Tests.Schema
}", json); }", json);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test] [Test]
public void GenerateSchemaSerializable() public void GenerateSchemaSerializable()
{ {
@@ -837,7 +837,7 @@ namespace Newtonsoft.Json.Tests.Schema
{ {
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Serializable] [Serializable]
public sealed class SerializableTestObject public sealed class SerializableTestObject
{ {
@@ -159,7 +159,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void DynamicCamelCasePropertyNames() public void DynamicCamelCasePropertyNames()
{ {
@@ -119,7 +119,7 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = o.ToString(); string json = o.ToString();
} }
#if !(PORTABLE || PORTABLE40) #if !(PORTABLE)
#pragma warning disable 618 #pragma warning disable 618
[Test] [Test]
public void MemberSearchFlags() public void MemberSearchFlags()
@@ -196,7 +196,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void DynamicCamelCasePropertyNames() public void DynamicCamelCasePropertyNames()
{ {
@@ -115,7 +115,7 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture] [TestFixture]
public class ContractResolverTests : TestFixtureBase public class ContractResolverTests : TestFixtureBase
{ {
#if !(PORTABLE) || NETSTANDARD1_1 #if !(PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void ResolveSerializableContract() public void ResolveSerializableContract()
{ {
@@ -573,7 +573,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", startingWithB); }", startingWithB);
} }
#if !(PORTABLE || PORTABLE40) #if !(PORTABLE)
#pragma warning disable 618 #pragma warning disable 618
[Test] [Test]
public void SerializeCompilerGeneratedMembers() public void SerializeCompilerGeneratedMembers()
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET40 || NET35 || NET20 || DNXCORE50 || PORTABLE || PORTABLE40) #if !(NET40 || NET35 || NET20 || DNXCORE50 || PORTABLE)
using Autofac; using Autofac;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Tests.TestObjects; using Newtonsoft.Json.Tests.TestObjects;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@@ -101,7 +101,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(dynamicObject.ChildObject.Text, d.ChildObject.Text); Assert.AreEqual(dynamicObject.ChildObject.Text, d.ChildObject.Text);
} }
#if !(PORTABLE || PORTABLE40) #if !(PORTABLE)
[Test] [Test]
public void SerializeDynamicObjectWithObjectTracking() public void SerializeDynamicObjectWithObjectTracking()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET35 || NET20 || PORTABLE || DNXCORE50 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE || DNXCORE50)
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
@@ -27,7 +27,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Runtime.Serialization; using System.Runtime.Serialization;
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
using System.Collections.Concurrent; using System.Collections.Concurrent;
#endif #endif
using System.Collections.Generic; using System.Collections.Generic;
@@ -54,7 +54,7 @@ using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else #else
using NUnit.Framework; using NUnit.Framework;
#endif #endif
#if !NET20 && !PORTABLE40 #if !NET20
using System.Xml.Linq; using System.Xml.Linq;
#endif #endif
@@ -353,7 +353,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
#endif #endif
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
public class SomeObject public class SomeObject
{ {
public string Text1 { get; set; } public string Text1 { get; set; }
@@ -640,7 +640,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual("string!", l[0]); Assert.AreEqual("string!", l[0]);
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20)
[Test] [Test]
public void DeserializeReadOnlyListInterface() public void DeserializeReadOnlyListInterface()
{ {
@@ -995,7 +995,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(3, v2["Third"]); Assert.AreEqual(3, v2["Third"]);
} }
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
[Test] [Test]
public void DeserializeConcurrentDictionary() public void DeserializeConcurrentDictionary()
{ {
@@ -1073,7 +1073,7 @@ namespace Newtonsoft.Json.Tests.Serialization
ExceptionAssert.Throws<JsonSerializationException>(() => { JsonConvert.DeserializeObject<IList<KeyValuePair<string, IList<string>>>>(json); }, "Cannot convert null value to KeyValuePair. Path '[0]', line 1, position 6."); ExceptionAssert.Throws<JsonSerializationException>(() => { JsonConvert.DeserializeObject<IList<KeyValuePair<string, IList<string>>>>(json); }, "Cannot convert null value to KeyValuePair. Path '[0]', line 1, position 6.");
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20)
public class PopulateReadOnlyTestClass public class PopulateReadOnlyTestClass
{ {
public IList<int> NonReadOnlyList { get; set; } public IList<int> NonReadOnlyList { get; set; }
@@ -1916,7 +1916,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual("Product 1", p1.Name); Assert.AreEqual("Product 1", p1.Name);
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20)
[Test] [Test]
public void ReadOnlyIntegerList() public void ReadOnlyIntegerList()
{ {
@@ -1966,7 +1966,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}, "Unable to find a constructor to use for type Newtonsoft.Json.Tests.Serialization.ReadOnlyCollectionWithArrayArgument`1[System.Double]. Path '', line 1, position 1."); }, "Unable to find a constructor to use for type Newtonsoft.Json.Tests.Serialization.ReadOnlyCollectionWithArrayArgument`1[System.Double]. Path '', line 1, position 1.");
} }
#if !NET20 && !PORTABLE40 #if !NET20
[Test] [Test]
public void NonDefaultConstructor_DuplicateKeyInDictionary_Replace() public void NonDefaultConstructor_DuplicateKeyInDictionary_Replace()
{ {
@@ -2085,7 +2085,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
} }
#if !NET20 && !PORTABLE40 #if !NET20
public class CASResponce public class CASResponce
{ {
//<?xml version='1.0' encoding='iso-8859-1' ?> //<?xml version='1.0' encoding='iso-8859-1' ?>
@@ -2389,7 +2389,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20)
public class ReadOnlyIntegerList : IReadOnlyCollection<int> public class ReadOnlyIntegerList : IReadOnlyCollection<int>
{ {
private readonly List<int> _list; private readonly List<int> _list;
@@ -29,7 +29,7 @@ using System.ComponentModel;
using System.Collections.Concurrent; using System.Collections.Concurrent;
#endif #endif
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
#if !(NET20 || DNXCORE50) #if !(NET20 || DNXCORE50)
@@ -295,7 +295,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
} }
#if !(PORTABLE || PORTABLE40 || NET20 || NET35) #if !(PORTABLE || NET20 || NET35)
[Test] [Test]
public void LargeIntegerAsString() public void LargeIntegerAsString()
{ {
@@ -356,7 +356,7 @@ namespace Newtonsoft.Json.Tests.Serialization
@"Error converting value {null} to type 'System.Boolean'. Path '[0]', line 1, position 3."); @"Error converting value {null} to type 'System.Boolean'. Path '[0]', line 1, position 3.");
} }
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) #if !(PORTABLE || NET35 || NET20)
[Test] [Test]
public void DeserializeBooleans() public void DeserializeBooleans()
{ {
@@ -1022,7 +1022,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public int ChildId; public int ChildId;
} }
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
[Test] [Test]
public void ReadIntegerWithError() public void ReadIntegerWithError()
{ {
@@ -1390,7 +1390,7 @@ namespace Newtonsoft.Json.Tests.Serialization
serializer.TraceWriter = traceWriter; serializer.TraceWriter = traceWriter;
Assert.AreEqual(traceWriter, serializer.TraceWriter); Assert.AreEqual(traceWriter, serializer.TraceWriter);
#if !(PORTABLE || PORTABLE40 || NET20 || DNXCORE50) #if !(PORTABLE || NET20 || DNXCORE50)
#pragma warning disable 618 #pragma warning disable 618
serializer.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full; serializer.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full;
Assert.AreEqual(FormatterAssemblyStyle.Full, serializer.TypeNameAssemblyFormat); Assert.AreEqual(FormatterAssemblyStyle.Full, serializer.TypeNameAssemblyFormat);
@@ -1505,7 +1505,7 @@ namespace Newtonsoft.Json.Tests.Serialization
settings.TraceWriter = traceWriter; settings.TraceWriter = traceWriter;
Assert.AreEqual(traceWriter, settings.TraceWriter); Assert.AreEqual(traceWriter, settings.TraceWriter);
#if !(PORTABLE || PORTABLE40 || NET20 || DNXCORE50) #if !(PORTABLE || NET20 || DNXCORE50)
#pragma warning disable 618 #pragma warning disable 618
settings.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full; settings.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full;
Assert.AreEqual(FormatterAssemblyStyle.Full, settings.TypeNameAssemblyFormat); Assert.AreEqual(FormatterAssemblyStyle.Full, settings.TypeNameAssemblyFormat);
@@ -1627,7 +1627,7 @@ namespace Newtonsoft.Json.Tests.Serialization
serializerProxy.TraceWriter = traceWriter; serializerProxy.TraceWriter = traceWriter;
Assert.AreEqual(traceWriter, serializerProxy.TraceWriter); Assert.AreEqual(traceWriter, serializerProxy.TraceWriter);
#if !(PORTABLE || PORTABLE40 || NET20 || DNXCORE50) #if !(PORTABLE || NET20 || DNXCORE50)
#pragma warning disable 618 #pragma warning disable 618
serializerProxy.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full; serializerProxy.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full;
Assert.AreEqual(FormatterAssemblyStyle.Full, serializerProxy.TypeNameAssemblyFormat); Assert.AreEqual(FormatterAssemblyStyle.Full, serializerProxy.TypeNameAssemblyFormat);
@@ -1648,7 +1648,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(TypeNameHandling.All, serializerProxy.TypeNameHandling); Assert.AreEqual(TypeNameHandling.All, serializerProxy.TypeNameHandling);
} }
#if !(PORTABLE || PORTABLE40 || DNXCORE50) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void DeserializeISerializableIConvertible() public void DeserializeISerializableIConvertible()
{ {
@@ -2811,7 +2811,7 @@ keyword such as type of business.""
ConverableMembers c = JsonConvert.DeserializeObject<ConverableMembers>(json); ConverableMembers c = JsonConvert.DeserializeObject<ConverableMembers>(json);
Assert.AreEqual("string", c.String); Assert.AreEqual("string", c.String);
Assert.AreEqual(double.MaxValue, c.Double); Assert.AreEqual(double.MaxValue, c.Double);
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
Assert.AreEqual(DBNull.Value, c.DBNull); Assert.AreEqual(DBNull.Value, c.DBNull);
#endif #endif
} }
@@ -4062,7 +4062,7 @@ Path '', line 1, position 1.");
@"Unexpected character encountered while parsing value: [. Path '', line 1, position 1."); @"Unexpected character encountered while parsing value: [. Path '', line 1, position 1.");
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void CannotDeserializeArrayIntoDynamic() public void CannotDeserializeArrayIntoDynamic()
{ {
@@ -4158,7 +4158,7 @@ Path '', line 1, position 1.");
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -4175,7 +4175,7 @@ Path '', line 1, position 1.");
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -4192,7 +4192,7 @@ Path '', line 1, position 1.");
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -4209,7 +4209,7 @@ Path '', line 1, position 1.");
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -4984,7 +4984,7 @@ Path '', line 1, position 1.");
Assert.AreEqual("value", newModelStateDictionary["key"]); Assert.AreEqual("value", newModelStateDictionary["key"]);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
#if DEBUG #if DEBUG
[Test] [Test]
public void SerializeISerializableInPartialTrustWithIgnoreInterface() public void SerializeISerializableInPartialTrustWithIgnoreInterface()
@@ -5403,7 +5403,7 @@ Path '', line 1, position 1.");
} }
#endif #endif
#if !(NET20 || PORTABLE40) #if !(NET20)
[Test] [Test]
public void SerializeDeserializeXNodeProperties() public void SerializeDeserializeXNodeProperties()
{ {
@@ -5434,7 +5434,7 @@ Path '', line 1, position 1.");
} }
#endif #endif
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void SerializeDeserializeXmlNodeProperties() public void SerializeDeserializeXmlNodeProperties()
{ {
@@ -5918,7 +5918,7 @@ Path '', line 1, position 1.");
}", json); }", json);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void SerializeExpandoObject() public void SerializeExpandoObject()
{ {
@@ -6836,7 +6836,7 @@ Path '', line 1, position 1.");
} }
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void SerializeException1() public void SerializeException1()
{ {
@@ -8014,7 +8014,7 @@ Path '', line 1, position 1.");
Assert.AreEqual("", s); Assert.AreEqual("", s);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test] [Test]
public void SerializeAndDeserializeWithAttributes() public void SerializeAndDeserializeWithAttributes()
{ {
@@ -8217,7 +8217,7 @@ lines.*/
ExceptionAssert.Throws<JsonReaderException>(() => { s.Deserialize<Dictionary<string, int>>(new JsonTextReader(new StringReader(json))); }, "Additional text encountered after finished reading JSON content: {. Path '', line 7, position 0."); ExceptionAssert.Throws<JsonReaderException>(() => { s.Deserialize<Dictionary<string, int>>(new JsonTextReader(new StringReader(json))); }, "Additional text encountered after finished reading JSON content: {. Path '', line 7, position 0.");
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void DeserializeException() public void DeserializeException()
{ {
@@ -8445,8 +8445,8 @@ This is just junk, though.";
Assert.AreEqual("[1.1,0.0,0.0]", json); Assert.AreEqual("[1.1,0.0,0.0]", json);
} }
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
#if !PORTABLE || NETSTANDARD1_1 #if !PORTABLE || NETSTANDARD1_3
[Test] [Test]
public void DeserializeReadOnlyListWithBigInteger() public void DeserializeReadOnlyListWithBigInteger()
{ {
@@ -8504,7 +8504,7 @@ This is just junk, though.";
Action doStuff = () => { obj = JsonConvert.DeserializeObject<MyTuple<int>>(json); }; Action doStuff = () => { obj = JsonConvert.DeserializeObject<MyTuple<int>>(json); };
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
doStuff(); doStuff();
Assert.AreEqual(500, obj.Item1); Assert.AreEqual(500, obj.Item1);
#else #else
@@ -8535,7 +8535,7 @@ This is just junk, though.";
} }
#endif #endif
#if !(PORTABLE || NET35 || NET20 || PORTABLE40 || DNXCORE50) #if !(PORTABLE || NET35 || NET20 || DNXCORE50)
[Test] [Test]
public void SerializeTupleWithSerializableAttribute() public void SerializeTupleWithSerializableAttribute()
{ {
@@ -8753,7 +8753,7 @@ This is just junk, though.";
ExceptionAssert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<NoConstructorReadOnlyCollection<int>>("[1]"), "Cannot deserialize readonly or fixed size list: Newtonsoft.Json.Tests.Serialization.JsonSerializerTest+NoConstructorReadOnlyCollection`1[System.Int32]. Path '', line 1, position 1."); ExceptionAssert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<NoConstructorReadOnlyCollection<int>>("[1]"), "Cannot deserialize readonly or fixed size list: Newtonsoft.Json.Tests.Serialization.JsonSerializerTest+NoConstructorReadOnlyCollection`1[System.Int32]. Path '', line 1, position 1.");
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20)
public class NoConstructorReadOnlyDictionary<TKey, TValue> : ReadOnlyDictionary<TKey, TValue> public class NoConstructorReadOnlyDictionary<TKey, TValue> : ReadOnlyDictionary<TKey, TValue>
{ {
public NoConstructorReadOnlyDictionary() public NoConstructorReadOnlyDictionary()
@@ -8769,7 +8769,7 @@ This is just junk, though.";
} }
#endif #endif
#if !(PORTABLE || NET35 || NET20 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || NET35 || NET20) || NETSTANDARD1_3
[Test] [Test]
public void ReadTooLargeInteger() public void ReadTooLargeInteger()
{ {
@@ -8812,7 +8812,7 @@ This is just junk, though.";
Assert.AreEqual(@"{""First"":""One"",""Second"":2}", json); Assert.AreEqual(@"{""First"":""One"",""Second"":2}", json);
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
DefaultContractResolver r = new DefaultContractResolver(); DefaultContractResolver r = new DefaultContractResolver();
r.IgnoreSerializableAttribute = false; r.IgnoreSerializableAttribute = false;
@@ -8928,7 +8928,7 @@ This is just junk, though.";
Assert.AreEqual(1234567890.123456m, d); Assert.AreEqual(1234567890.123456m, d);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test] [Test]
public void DontSerializeStaticFields() public void DontSerializeStaticFields()
{ {
@@ -8952,7 +8952,7 @@ This is just junk, though.";
} }
#endif #endif
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void SerializeBigInteger() public void SerializeBigInteger()
{ {
@@ -9092,7 +9092,7 @@ This is just junk, though.";
]", json); ]", json);
} }
#if !(PORTABLE || PORTABLE40 || DNXCORE50) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void SerializeDictionaryWithStructKey() public void SerializeDictionaryWithStructKey()
{ {
@@ -9109,7 +9109,7 @@ This is just junk, though.";
} }
#endif #endif
#if !(PORTABLE || PORTABLE40 || DNXCORE50) || NETSTANDARD1_0 || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_0 || NETSTANDARD1_3
[Test] [Test]
public void SerializeDictionaryWithStructKey_Custom() public void SerializeDictionaryWithStructKey_Custom()
{ {
@@ -9296,7 +9296,7 @@ This is just junk, though.";
Assert.AreEqual(jane, john.Spouse); Assert.AreEqual(jane, john.Spouse);
} }
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
[Test] [Test]
public void TypeConverterOnInterface() public void TypeConverterOnInterface()
{ {
@@ -9874,7 +9874,7 @@ This is just junk, though.";
Assert.AreEqual("derived", d.DerivedProperty); Assert.AreEqual("derived", d.DerivedProperty);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE)
[Test] [Test]
public void DeserializeNullableUnsignedLong() public void DeserializeNullableUnsignedLong()
{ {
@@ -10256,7 +10256,7 @@ This is just junk, though.";
public string Project { get; } public string Project { get; }
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
public class ISerializableTestObject : ISerializable public class ISerializableTestObject : ISerializable
{ {
internal string _stringValue; internal string _stringValue;
@@ -339,7 +339,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.IsTrue(JToken.DeepEquals(t1, t2)); Assert.IsTrue(JToken.DeepEquals(t1, t2));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void DeserializeGenericObjectListWithTypeName() public void DeserializeGenericObjectListWithTypeName()
{ {
@@ -151,7 +151,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
public class MainClass : ISerializable public class MainClass : ISerializable
{ {
public ChildClass Child { get; set; } public ChildClass Child { get; set; }
@@ -210,7 +210,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
#endif #endif
#if !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35)
public class DictionaryDynamicObject : DynamicObject public class DictionaryDynamicObject : DynamicObject
{ {
public IDictionary<string, object> Values { get; private set; } public IDictionary<string, object> Values { get; private set; }
@@ -693,7 +693,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(@"Unexpected end when deserializing object. Path 'events2.code', line 1, position 49.", errors[1]); Assert.AreEqual(@"Unexpected end when deserializing object. Path 'events2.code', line 1, position 49.", errors[1]);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void ErrorHandlingEndOfContentDynamic() public void ErrorHandlingEndOfContentDynamic()
{ {
@@ -159,7 +159,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void DynamicSnakeCasePropertyNames() public void DynamicSnakeCasePropertyNames()
{ {
@@ -4,7 +4,7 @@ using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
using System.Numerics; using System.Numerics;
#endif #endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
@@ -41,7 +41,7 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture] [TestFixture]
public class TraceWriterTests : TestFixtureBase public class TraceWriterTests : TestFixtureBase
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void DiagnosticsTraceWriterTest() public void DiagnosticsTraceWriterTest()
{ {
@@ -730,7 +730,7 @@ Newtonsoft.Json Error: 0 : Error!
Assert.IsTrue(traceWriter.TraceRecords[9].Message.StartsWith("Finished deserializing System.Collections.Generic.List`1[System.Object]. Path '$values'")); Assert.IsTrue(traceWriter.TraceRecords[9].Message.StartsWith("Finished deserializing System.Collections.Generic.List`1[System.Object]. Path '$values'"));
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[Test] [Test]
public void DeserializeISerializable() public void DeserializeISerializable()
{ {
@@ -936,7 +936,7 @@ Newtonsoft.Json Error: 0 : Error!
Assert.AreEqual(23, deserialized.FavoriteNumber); Assert.AreEqual(23, deserialized.FavoriteNumber);
} }
#if !(NET20 || NET35 || PORTABLE || PORTABLE40) || NETSTANDARD1_1 #if !(NET20 || NET35 || PORTABLE) || NETSTANDARD1_3
[Test] [Test]
public void TraceJsonWriterTest() public void TraceJsonWriterTest()
{ {
@@ -28,7 +28,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
#else #else
using System.Linq; using System.Linq;
#endif #endif
#if !(PORTABLE || PORTABLE40) #if !(PORTABLE)
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
#if !(NET35 || NET20) #if !(NET35 || NET20)
using System.Dynamic; using System.Dynamic;
@@ -1737,7 +1737,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(1, (int)j["MyProperty"]); Assert.AreEqual(1, (int)j["MyProperty"]);
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
[Test] [Test]
public void PropertyItemTypeNameHandlingDynamic() public void PropertyItemTypeNameHandlingDynamic()
{ {
@@ -2036,7 +2036,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
#endif #endif
#if !(NET20 || PORTABLE || PORTABLE40) #if !(NET20 || PORTABLE)
[Test] [Test]
public void DeserializeComplexGenericDictionary_Simple() public void DeserializeComplexGenericDictionary_Simple()
{ {
@@ -2329,7 +2329,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public TypeNameHandlingTestObject Data { get; set; } public TypeNameHandlingTestObject Data { get; set; }
} }
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20)
public class PropertyItemTypeNameHandlingDynamic public class PropertyItemTypeNameHandlingDynamic
{ {
[JsonProperty(ItemTypeNameHandling = TypeNameHandling.All)] [JsonProperty(ItemTypeNameHandling = TypeNameHandling.All)]
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization
nonSerializedField = "Error" nonSerializedField = "Error"
}; };
#if !(NET20 || NET35 || PORTABLE || DNXCORE50 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || DNXCORE50)
MemoryStream ms = new MemoryStream(); MemoryStream ms = new MemoryStream();
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType)); DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType));
dataContractJsonSerializer.WriteObject(ms, serializableType); dataContractJsonSerializer.WriteObject(ms, serializableType);
@@ -75,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = false IgnoreSerializableAttribute = false
#endif #endif
} }
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(expected, json); Assert.AreEqual(expected, json);
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test] [Test]
public void SerializeInheritedType() public void SerializeInheritedType()
{ {
@@ -114,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Serializable] [Serializable]
#else #else
[JsonObject(MemberSerialization.Fields)] [JsonObject(MemberSerialization.Fields)]
@@ -138,7 +138,7 @@ namespace Newtonsoft.Json.Tests.Serialization
set { privateField = value; } set { privateField = value; }
} }
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
[NonSerialized] [NonSerialized]
#else #else
[JsonIgnore] [JsonIgnore]
+2 -2
View File
@@ -45,7 +45,7 @@ using NUnit.Framework;
#endif #endif
using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities;
using System.Collections; using System.Collections;
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
using System.Threading.Tasks; using System.Threading.Tasks;
#endif #endif
#if NET20 #if NET20
@@ -388,7 +388,7 @@ namespace Newtonsoft.Json.Tests
} }
} }
#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !(NET20 || NET35 || NET40)
public static async Task<TException> ThrowsAsync<TException>(Func<Task> action, params string[] possibleMessages) public static async Task<TException> ThrowsAsync<TException>(Func<Task> action, params string[] possibleMessages)
where TException : Exception where TException : Exception
{ {
@@ -34,7 +34,7 @@ using System.Linq;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Serializable] [Serializable]
public class AnswerFilterModel public class AnswerFilterModel
{ {
@@ -27,7 +27,7 @@ using System.ComponentModel;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
[TypeConverter(typeof(MyInterfaceConverter))] [TypeConverter(typeof(MyInterfaceConverter))]
internal class ConsoleWriter : IMyInterface internal class ConsoleWriter : IMyInterface
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE40 || PORTABLE || DNXCORE50) #if !(PORTABLE || DNXCORE50)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@@ -27,7 +27,7 @@ using System.ComponentModel;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
[TypeConverter(typeof(MyInterfaceConverter))] [TypeConverter(typeof(MyInterfaceConverter))]
internal interface IMyInterface internal interface IMyInterface
{ {
@@ -35,7 +35,7 @@ using System.Linq;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
internal class MyInterfaceConverter : TypeConverter internal class MyInterfaceConverter : TypeConverter
{ {
private readonly List<IMyInterface> _writers = new List<IMyInterface> private readonly List<IMyInterface> _writers = new List<IMyInterface>
@@ -27,7 +27,7 @@ using System;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_1 #if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Serializable] [Serializable]
public class PersonSerializable public class PersonSerializable
{ {
@@ -25,7 +25,7 @@
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
internal class TraceWriter : IMyInterface internal class TraceWriter : IMyInterface
{ {
public string Name public string Name
@@ -34,7 +34,7 @@ using Newtonsoft.Json.Utilities;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE)
internal class TypeConverterJsonConverter : JsonConverter internal class TypeConverterJsonConverter : JsonConverter
{ {
private TypeConverter GetConverter(Type type) private TypeConverter GetConverter(Type type)
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.Reflection;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(PORTABLE || DNXCORE50 || PORTABLE40) #if !(PORTABLE || DNXCORE50)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters;
@@ -36,6 +36,9 @@
<PropertyGroup Condition="'$(TargetFramework)'=='net20'"> <PropertyGroup Condition="'$(TargetFramework)'=='net20'">
<DefineConstants>NET20;HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CAS;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_DB_NULL_TYPE_CODE;HAVE_EMPTY_TYPES;HAVE_FULL_REFLECTION;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_MEMORY_BARRIER;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_REFLECTION_EMIT;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_XML_DOCUMENT;$(AdditionalConstants)</DefineConstants> <DefineConstants>NET20;HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CAS;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_DB_NULL_TYPE_CODE;HAVE_EMPTY_TYPES;HAVE_FULL_REFLECTION;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_MEMORY_BARRIER;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_REFLECTION_EMIT;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_XML_DOCUMENT;$(AdditionalConstants)</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="**\*.orig" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' OR '$(TargetFramework)' == 'netstandard1.3'"> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' OR '$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
<PackageReference Include="System.Collections" Version="4.3.0" /> <PackageReference Include="System.Collections" Version="4.3.0" />
@@ -73,7 +76,7 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'"> <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<AssemblyTitle>Json.NET .NET Standard 1.3</AssemblyTitle> <AssemblyTitle>Json.NET .NET Standard 1.3</AssemblyTitle>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<DefineConstants>NETSTANDARD1_1;PORTABLE;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_SERIALIZATION;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DYNAMIC;HAVE_EXPRESSIONS;HAVE_FSHARP_TYPES;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_IMMUTABLE_COLLECTIONS;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_ISET;HAVE_LINQ;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_BINDER;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_OBSOLETE_FORMATTER_ASSEMBLY_STYLE;$(AdditionalConstants)</DefineConstants> <DefineConstants>NETSTANDARD1_3;PORTABLE;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_SERIALIZATION;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DYNAMIC;HAVE_EXPRESSIONS;HAVE_FSHARP_TYPES;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_IMMUTABLE_COLLECTIONS;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_ISET;HAVE_LINQ;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_BINDER;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_OBSOLETE_FORMATTER_ASSEMBLY_STYLE;$(AdditionalConstants)</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'portable-net45+win8+wpa81+wp8'"> <PropertyGroup Condition="'$(TargetFramework)' == 'portable-net45+win8+wpa81+wp8'">
<DefineConstants>PORTABLE;HAVE_ASYNC;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DYNAMIC;HAVE_EXPRESSIONS;HAVE_FSHARP_TYPES;HAVE_GUID_TRY_PARSE;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_IMMUTABLE_COLLECTIONS;HAVE_ISET;HAVE_LINQ;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_BINDER;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_OBSOLETE_FORMATTER_ASSEMBLY_STYLE;$(AdditionalConstants)</DefineConstants> <DefineConstants>PORTABLE;HAVE_ASYNC;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DYNAMIC;HAVE_EXPRESSIONS;HAVE_FSHARP_TYPES;HAVE_GUID_TRY_PARSE;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_IMMUTABLE_COLLECTIONS;HAVE_ISET;HAVE_LINQ;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_BINDER;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_OBSOLETE_FORMATTER_ASSEMBLY_STYLE;$(AdditionalConstants)</DefineConstants>
@@ -34,10 +34,8 @@ using System.Security;
// associated with an assembly. // associated with an assembly.
#if NETSTANDARD1_0 #if NETSTANDARD1_0
[assembly: AssemblyTitle("Json.NET .NET Standard 1.0")] [assembly: AssemblyTitle("Json.NET .NET Standard 1.0")]
#elif NETSTANDARD1_1 #elif NETSTANDARD1_3
[assembly: AssemblyTitle("Json.NET .NET Standard 1.3")] [assembly: AssemblyTitle("Json.NET .NET Standard 1.3")]
#elif PORTABLE40
[assembly: AssemblyTitle("Json.NET Portable .NET 4.0")]
#elif PORTABLE #elif PORTABLE
[assembly: AssemblyTitle("Json.NET Portable")] [assembly: AssemblyTitle("Json.NET Portable")]
#elif DOTNET #elif DOTNET
@@ -1331,7 +1331,7 @@ namespace Newtonsoft.Json.Serialization
// warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes // warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes
IValueProvider valueProvider; IValueProvider valueProvider;
#if !(PORTABLE40 || PORTABLE || DOTNET) #if !(PORTABLE || DOTNET)
if (DynamicCodeGeneration) if (DynamicCodeGeneration)
{ {
valueProvider = new DynamicValueProvider(member); valueProvider = new DynamicValueProvider(member);
@@ -1340,10 +1340,8 @@ namespace Newtonsoft.Json.Serialization
{ {
valueProvider = new ReflectionValueProvider(member); valueProvider = new ReflectionValueProvider(member);
} }
#elif !(PORTABLE40)
valueProvider = new ExpressionValueProvider(member);
#else #else
valueProvider = new ReflectionValueProvider(member); valueProvider = new ExpressionValueProvider(member);
#endif #endif
return valueProvider; return valueProvider;
@@ -62,7 +62,7 @@ namespace Newtonsoft.Json.Serialization
{ {
Assembly assembly; Assembly assembly;
#if !(DOTNET || PORTABLE40 || PORTABLE) #if !(DOTNET || PORTABLE)
// look, I don't like using obsolete methods as much as you do but this is the only way // look, I don't like using obsolete methods as much as you do but this is the only way
// Assembly.Load won't check the GAC for a partial name // Assembly.Load won't check the GAC for a partial name
#pragma warning disable 618,612 #pragma warning disable 618,612
@@ -479,9 +479,9 @@ namespace Newtonsoft.Json.Serialization
{ {
if (_fullyTrusted == null) if (_fullyTrusted == null)
{ {
#if (DOTNET || PORTABLE || PORTABLE40) #if (DOTNET || PORTABLE)
_fullyTrusted = true; _fullyTrusted = true;
#elif !(NET20 || NET35 || PORTABLE40) #elif !(NET20 || NET35)
AppDomain appDomain = AppDomain.CurrentDomain; AppDomain appDomain = AppDomain.CurrentDomain;
_fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted; _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted;
@@ -506,7 +506,7 @@ namespace Newtonsoft.Json.Serialization
{ {
get get
{ {
#if !(PORTABLE40 || PORTABLE || DOTNET) #if !(PORTABLE || DOTNET)
if (DynamicCodeGeneration) if (DynamicCodeGeneration)
{ {
return DynamicReflectionDelegateFactory.Instance; return DynamicReflectionDelegateFactory.Instance;
+1 -1
View File
@@ -1,5 +1,5 @@
 
#if (DOTNET || PORTABLE40 || PORTABLE) #if (DOTNET || PORTABLE)
using System; using System;
using System.Reflection; using System.Reflection;
@@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Utilities
#endif #endif
} }
#if !(PORTABLE40 || PORTABLE) #if !(PORTABLE)
public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind) public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind)
{ {
switch (kind) switch (kind)
@@ -43,7 +43,7 @@ using Newtonsoft.Json.Serialization;
namespace Newtonsoft.Json.Utilities namespace Newtonsoft.Json.Utilities
{ {
#if (DOTNET || PORTABLE || PORTABLE40) #if (DOTNET || PORTABLE)
internal enum MemberTypes internal enum MemberTypes
{ {
Property = 0, Property = 0,
@@ -790,13 +790,11 @@ namespace Newtonsoft.Json.Utilities
return (attributeType != null) ? Attribute.GetCustomAttributes(mi, attributeType, inherit) : Attribute.GetCustomAttributes(mi, inherit); return (attributeType != null) ? Attribute.GetCustomAttributes(mi, attributeType, inherit) : Attribute.GetCustomAttributes(mi, inherit);
} }
#if !PORTABLE40
Module m = provider as Module; Module m = provider as Module;
if (m != null) if (m != null)
{ {
return (attributeType != null) ? Attribute.GetCustomAttributes(m, attributeType, inherit) : Attribute.GetCustomAttributes(m, inherit); return (attributeType != null) ? Attribute.GetCustomAttributes(m, attributeType, inherit) : Attribute.GetCustomAttributes(m, inherit);
} }
#endif
ParameterInfo p = provider as ParameterInfo; ParameterInfo p = provider as ParameterInfo;
if (p != null) if (p != null)
@@ -804,14 +802,10 @@ namespace Newtonsoft.Json.Utilities
return (attributeType != null) ? Attribute.GetCustomAttributes(p, attributeType, inherit) : Attribute.GetCustomAttributes(p, inherit); return (attributeType != null) ? Attribute.GetCustomAttributes(p, attributeType, inherit) : Attribute.GetCustomAttributes(p, inherit);
} }
#if !PORTABLE40
ICustomAttributeProvider customAttributeProvider = (ICustomAttributeProvider)attributeProvider; ICustomAttributeProvider customAttributeProvider = (ICustomAttributeProvider)attributeProvider;
object[] result = (attributeType != null) ? customAttributeProvider.GetCustomAttributes(attributeType, inherit) : customAttributeProvider.GetCustomAttributes(inherit); object[] result = (attributeType != null) ? customAttributeProvider.GetCustomAttributes(attributeType, inherit) : customAttributeProvider.GetCustomAttributes(inherit);
return (Attribute[])result; return (Attribute[])result;
#else
throw new Exception("Cannot get attributes from '{0}'.".FormatWith(CultureInfo.InvariantCulture, provider));
#endif
} }
#else #else
public static T[] GetAttributes<T>(object attributeProvider, bool inherit) where T : Attribute public static T[] GetAttributes<T>(object attributeProvider, bool inherit) where T : Attribute
@@ -107,7 +107,7 @@ namespace Newtonsoft.Json.Utilities
public static MemberTypes MemberType(this MemberInfo memberInfo) public static MemberTypes MemberType(this MemberInfo memberInfo)
{ {
#if !(DOTNET || PORTABLE || PORTABLE40) #if !(DOTNET || PORTABLE)
return memberInfo.MemberType; return memberInfo.MemberType;
#else #else
if (memberInfo is PropertyInfo) if (memberInfo is PropertyInfo)
@@ -214,7 +214,7 @@ namespace Newtonsoft.Json.Utilities
#endif #endif
} }
#if (PORTABLE40 || DOTNET || PORTABLE) #if (DOTNET || PORTABLE)
public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList<Type> indexParameters, object placeholder2) public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList<Type> indexParameters, object placeholder2)
{ {
IEnumerable<PropertyInfo> propertyInfos = type.GetProperties(bindingFlags); IEnumerable<PropertyInfo> propertyInfos = type.GetProperties(bindingFlags);