Revert "-Removed binary serialization support from netstandard1.3"

This reverts commit 25de5022e4.
This commit is contained in:
James Newton-King
2017-04-01 22:38:45 +13:00
parent 2e18e592fd
commit d145eb36b0
6 changed files with 91 additions and 32 deletions
@@ -115,7 +115,7 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture]
public class ContractResolverTests : TestFixtureBase
{
#if !(PORTABLE)
#if !(PORTABLE) || NETSTANDARD1_3
[Test]
public void ResolveSerializableContract()
{
@@ -4194,7 +4194,7 @@ Path '', line 1, position 1.");
{
ContractResolver = new DefaultContractResolver
{
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true
#endif
}
@@ -4211,7 +4211,7 @@ Path '', line 1, position 1.");
{
ContractResolver = new DefaultContractResolver
{
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true
#endif
}
@@ -4228,7 +4228,7 @@ Path '', line 1, position 1.");
{
ContractResolver = new DefaultContractResolver
{
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = true
#endif
}
@@ -5020,7 +5020,7 @@ Path '', line 1, position 1.");
Assert.AreEqual("value", newModelStateDictionary["key"]);
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
#if DEBUG
[Test]
public void SerializeISerializableInPartialTrustWithIgnoreInterface()
@@ -8050,7 +8050,7 @@ Path '', line 1, position 1.");
Assert.AreEqual("", s);
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test]
public void SerializeAndDeserializeWithAttributes()
{
@@ -8848,7 +8848,7 @@ This is just junk, though.";
Assert.AreEqual(@"{""First"":""One"",""Second"":2}", json);
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
DefaultContractResolver r = new DefaultContractResolver();
r.IgnoreSerializableAttribute = false;
@@ -8964,7 +8964,7 @@ This is just junk, though.";
Assert.AreEqual(1234567890.123456m, d);
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test]
public void DontSerializeStaticFields()
{
@@ -10292,7 +10292,7 @@ This is just junk, though.";
public string Project { get; }
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
public class ISerializableTestObject : ISerializable
{
internal string _stringValue;
@@ -75,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{
ContractResolver = new DefaultContractResolver
{
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
IgnoreSerializableAttribute = false
#endif
}
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(expected, json);
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Test]
public void SerializeInheritedType()
{
@@ -114,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
}
#if !(PORTABLE || DNXCORE50)
#if !(PORTABLE || DNXCORE50) || NETSTANDARD1_3
[Serializable]
#else
[JsonObject(MemberSerialization.Fields)]