-Updated build to use .NET CLI

-.NET Standard 1.0 included in package
This commit is contained in:
James Newton-King
2016-05-14 13:43:43 +12:00
parent e31200aead
commit e8f4a3b651
17 changed files with 496 additions and 121 deletions
@@ -27,7 +27,7 @@ using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE || DNXCORE50)
using System.Runtime.Serialization.Json;
#endif
using System.Text;
@@ -5286,7 +5286,7 @@ Path '', line 1, position 1.");
}
#endif
#if !NETFX_CORE
#if !(NETFX_CORE || DNXCORE50)
public class XmlNodeTestObject
{
public XmlDocument Document { get; set; }
@@ -71,7 +71,12 @@ namespace Newtonsoft.Json.Tests.Serialization
[Test]
public void GetAttributes_Property()
{
PropertyInfo property = typeof(ReflectionTestObject).GetProperty("TestProperty");
PropertyInfo property;
#if DNXCORE50
property = Newtonsoft.Json.Utilities.TypeExtensions.GetProperty(typeof(ReflectionTestObject), "TestProperty");
#else
property = typeof(ReflectionTestObject).GetProperty("TestProperty");
#endif
ReflectionAttributeProvider provider = new ReflectionAttributeProvider(property);
@@ -85,7 +90,12 @@ namespace Newtonsoft.Json.Tests.Serialization
[Test]
public void GetAttributes_Field()
{
FieldInfo field = (FieldInfo)typeof(ReflectionTestObject).GetField("TestField");
FieldInfo field;
#if DNXCORE50
field = (FieldInfo)Newtonsoft.Json.Utilities.TypeExtensions.GetField(typeof(ReflectionTestObject), "TestField");
#else
field = typeof(ReflectionTestObject).GetField("TestField");
#endif
ReflectionAttributeProvider provider = new ReflectionAttributeProvider(field);
@@ -74,11 +74,14 @@ namespace Newtonsoft.Json.Tests.Serialization
var possibleMsgs = new[]
{
"[1] - Error message for member 1 = An item with the same key has already been added.",
"[1] - Error message for member 1 = An element with the same key already exists in the dictionary." // mono
"[1] - Error message for member 1 = An element with the same key already exists in the dictionary.", // mono
"[1] - Error message for member 1 = An item with the same key has already been added. Key: Jim" // netcore
};
VersionKeyedCollection c = JsonConvert.DeserializeObject<VersionKeyedCollection>(json);
Assert.AreEqual(1, c.Count);
Assert.AreEqual(1, c.Messages.Count);
Console.WriteLine(c.Messages[0]);
Assert.IsTrue(possibleMsgs.Any(m => m == c.Messages[0]), "Expected One of: " + Environment.NewLine + string.Join(Environment.NewLine, possibleMsgs) + Environment.NewLine + "Was: " + Environment.NewLine + c.Messages[0]);
}
@@ -41,7 +41,7 @@ using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
#if !(NETFX_CORE || NET20 || NET35)
#if !(NETFX_CORE || NET20 || NET35 || DNXCORE50)
using System.Runtime.Serialization.Json;
#endif
using Newtonsoft.Json.Serialization;