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
@@ -30,18 +30,14 @@ using System.IO;
using System.Linq;
#endif
using System.Text;
#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;
#else
using NUnit.Framework;
#endif
#if !(NETFX_CORE || NET20 || NET35 || DNXCORE50)
#if !(NET20 || NET35 || DNXCORE50)
using System.Runtime.Serialization.Json;
#endif
using Newtonsoft.Json.Serialization;
@@ -63,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization
nonSerializedField = "Error"
};
#if !(NETFX_CORE || NET20 || NET35 || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(NET20 || NET35 || PORTABLE || DNXCORE50 || PORTABLE40)
MemoryStream ms = new MemoryStream();
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType));
dataContractJsonSerializer.WriteObject(ms, serializableType);
@@ -79,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{
ContractResolver = new DefaultContractResolver
{
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
IgnoreSerializableAttribute = false
#endif
}
@@ -88,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(expected, json);
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void SerializeInheritedType()
{
@@ -118,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Serializable]
#else
[JsonObject(MemberSerialization.Fields)]
@@ -142,7 +138,7 @@ namespace Newtonsoft.Json.Tests.Serialization
set { privateField = value; }
}
#if !(NETFX_CORE || PORTABLE || DNXCORE50 || PORTABLE40)
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[NonSerialized]
#else
[JsonIgnore]