Clean up NETFX_CORE directive usage

This commit is contained in:
Pyit Phyo Aung
2016-10-11 14:14:13 +13:00
parent e74d6c5a4b
commit f50f276b76
121 changed files with 218 additions and 1441 deletions
@@ -26,11 +26,7 @@
#pragma warning disable 618
using System;
using System.Collections.Generic;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -41,7 +37,7 @@ using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Linq;
using System.IO;
using Newtonsoft.Json.Tests.TestObjects;
#if !(NETFX_CORE || DNXCORE50)
#if !(DNXCORE50)
using System.Data;
#endif
@@ -207,7 +203,7 @@ namespace Newtonsoft.Json.Tests.Schema
#if !NET20
GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass());
#endif
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
GenerateSchemaAndSerializeFromType(new DataSet());
#endif
GenerateSchemaAndSerializeFromType(new object());
@@ -215,7 +211,7 @@ namespace Newtonsoft.Json.Tests.Schema
GenerateSchemaAndSerializeFromType("Hi");
GenerateSchemaAndSerializeFromType(new DateTime(2000, 12, 29, 23, 59, 0, DateTimeKind.Utc));
GenerateSchemaAndSerializeFromType(TimeSpan.FromTicks(1000000));
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
GenerateSchemaAndSerializeFromType(DBNull.Value);
#endif
GenerateSchemaAndSerializeFromType(new JsonPropertyWithHandlingValues());
@@ -25,11 +25,7 @@
#pragma warning disable 618
using System;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -32,11 +32,7 @@ using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Tests.TestObjects;
using Newtonsoft.Json.Utilities;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -96,7 +92,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(o.IsValid(schema));
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void Generate_DefaultValueAttributeTestClass()
{
@@ -315,7 +311,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(v.IsValid(schema));
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void GenerateSchemaForISerializable()
{
@@ -330,7 +326,7 @@ namespace Newtonsoft.Json.Tests.Schema
}
#endif
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void GenerateSchemaForDBNull()
{
@@ -379,7 +375,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CustomDirectoryInfoMapper
{
#if !(NETFX_CORE || PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50)
IgnoreSerializableAttribute = true
#endif
};
@@ -463,7 +459,7 @@ namespace Newtonsoft.Json.Tests.Schema
serializer.Converters.Add(new IsoDateTimeConverter());
serializer.ContractResolver = new CustomDirectoryInfoMapper
{
#if !(NETFX_CORE || PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50)
IgnoreSerializableInterface = true
#endif
};
@@ -483,7 +479,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CamelCasePropertyNamesContractResolver()
{
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
IgnoreSerializableAttribute = true
#endif
};
@@ -528,7 +524,7 @@ namespace Newtonsoft.Json.Tests.Schema
}", json);
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void GenerateSchemaSerializable()
{
@@ -25,11 +25,7 @@
#pragma warning disable 618
using Newtonsoft.Json.Schema;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -25,11 +25,7 @@
#pragma warning disable 618
using Newtonsoft.Json.Schema;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -24,7 +24,7 @@
#endregion
#pragma warning disable 618
#if !(DNXCORE50 || NETFX_CORE)
#if !(DNXCORE50)
using System;
using System.Collections.Generic;
using System.IO;
@@ -29,11 +29,7 @@ using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -30,11 +30,7 @@ using System.Diagnostics;
using System.IO;
using System.Text;
using Newtonsoft.Json.Schema;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;