-Updated NuGet packages

-Changed .NET Core test project to 1.1
This commit is contained in:
James Newton-King
2017-04-02 12:53:59 +12:00
parent aa5f28c097
commit f001339ae2
24 changed files with 112 additions and 48 deletions
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
namespace Newtonsoft.Json.Tests.Benchmarks
{
public static class BenchmarkConstants
@@ -76,4 +78,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
public const string JsonIsoText =
@"{""strings"":[null,""Markus egger ]><[, (2nd)"",null],""dictionary"":{""Val & asd1"":1,""Val2 & asd1"":3,""Val3 & asd1"":4},""Name"":""Rick"",""Now"":""2012-02-25T19:55:50.6095676+13:00"",""BigNumber"":34123123123.121,""Address1"":{""Street"":""fff Street"",""Phone"":""(503) 814-6335"",""Entered"":""2012-02-24T18:55:50.6095676+13:00""},""Addresses"":[{""Street"":""\u001farray<address"",""Phone"":""(503) 814-6335"",""Entered"":""2012-02-24T18:55:50.6095676+13:00""},{""Street"":""array 2 address"",""Phone"":""(503) 814-6335"",""Entered"":""2012-02-24T18:55:50.6095676+13:00""}]}";
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.Linq;
@@ -77,4 +79,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return JsonConvert.DeserializeObject<IList<decimal>>(FloatArrayJson);
}
}
}
}
#endif
@@ -23,16 +23,20 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
#if (!DNXCORE50)
using System.Runtime.Serialization.Formatters.Binary;
using System.Web.Script.Serialization;
#endif
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using BenchmarkDotNet.Attributes;
using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Linq;
@@ -67,6 +71,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return (T)dataContractSerializer.ReadObject(ms);
}
#if (!DNXCORE50)
[Benchmark]
public TestClass BinaryFormatter()
{
@@ -91,6 +96,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return ser.Deserialize<T>(json);
}
#endif
[Benchmark]
public TestClass DataContractJsonSerializer()
@@ -116,7 +122,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return DeserializeJsonNetManual(BenchmarkConstants.JsonText);
}
#region DeserializeJsonNetManual
#region DeserializeJsonNetManual
private TestClass DeserializeJsonNetManual(string json)
{
TestClass c = new TestClass();
@@ -204,7 +210,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
return a;
}
#endregion
#endregion
[Benchmark]
public Task<TestClass> JsonNetManualAsync()
@@ -320,4 +326,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
#pragma warning restore 618
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
@@ -94,4 +96,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return root;
}
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.Linq;
@@ -61,4 +63,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return (string)StringJValue;
}
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System.IO;
using System.Linq;
using System.Xml;
@@ -65,4 +67,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
}
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System.IO;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
@@ -44,4 +46,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return sw.ToString();
}
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
@@ -71,4 +73,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
_largeJArraySample.RemoveAt(_largeJArraySample.Count - 1);
}
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -87,3 +89,5 @@ If attributes are not mentioned, default values are used in each case.
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.Linq;
@@ -44,11 +46,16 @@ namespace Newtonsoft.Json.Tests.Benchmarks
[TestFixture]
public class Runner : TestFixtureBase
{
[Test]
#if DNXCORE50
[Test(Skip = "Don't run with other unit tests")]
#else
[Ignore("Don't run with other unit tests")]
#endif
public void RunBenchmarks()
{
new BenchmarkSwitcher(typeof(Runner).GetTypeInfo().Assembly).Run(new []{ "*" });
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
@@ -59,4 +61,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
}
}
}
}
#endif
@@ -23,16 +23,20 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
#if (!DNXCORE50)
using System.Runtime.Serialization.Formatters.Binary;
using System.Web.Script.Serialization;
#endif
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using BenchmarkDotNet.Attributes;
using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Linq;
@@ -91,6 +95,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
}
#if (!DNXCORE50)
[Benchmark]
public byte[] BinaryFormatter()
{
@@ -118,6 +123,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return ser.Serialize(value);
}
#endif
[Benchmark]
public string DataContractJsonSerializer()
@@ -152,7 +158,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return SerializeJsonNetLinq(TestClass);
}
#region SerializeJsonNetManual
#region SerializeJsonNetManual
private string SerializeJsonNetLinq(TestClass c)
{
JObject o = new JObject(
@@ -174,7 +180,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return o.ToString(Formatting.None);
}
#endregion
#endregion
[Benchmark]
public string JsonNetManual()
@@ -182,7 +188,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
return SerializeJsonNetManual(TestClass);
}
#region SerializeJsonNetManual
#region SerializeJsonNetManual
private string SerializeJsonNetManual(TestClass c)
{
StringWriter sw = new StringWriter();
@@ -237,7 +243,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
writer.Flush();
return sw.ToString();
}
#endregion
#endregion
[Benchmark]
public Task<string> JsonNetManualAsync()
@@ -328,4 +334,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
}
#pragma warning restore 618
}
}
}
#endif
@@ -23,6 +23,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET20 || NET35 || NET40 || PORTABLE || PORTABLE40) || DNXCORE50
using System;
using System.Collections.Generic;
using System.IO;
@@ -62,4 +64,6 @@ namespace Newtonsoft.Json.Tests.Benchmarks
JsonConvert.SerializeXNode(doc);
}
}
}
}
#endif