From 4f3f9d06eb0eab083adda605b015fc7c0a928e45 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 9 Jul 2013 10:35:41 +1200 Subject: [PATCH] -Fixed WinRT build --- .../Newtonsoft.Json.Tests.WinRT.csproj | 6 ++++++ .../Serialization/ImmutableCollectionsTests.cs | 6 ++++++ .../Serialization/JsonSerializerTest.cs | 6 ++++++ Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj | 1 + 4 files changed, 19 insertions(+) diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj index 6fe404bd..95c13cd0 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj @@ -164,6 +164,7 @@ + @@ -314,6 +315,11 @@ + + + ..\packages\Microsoft.Bcl.Immutable.1.0.12-beta\lib\portable-net45+win8+wp8\System.Collections.Immutable.dll + + 11.0 diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs index d3f189c5..f35a4d41 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs @@ -30,7 +30,13 @@ using System.Collections.Immutable; using System.Linq; using System.Text; using System.Threading.Tasks; +#if !NETFX_CORE using NUnit.Framework; +#else +using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; +using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; +using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; +#endif using Newtonsoft.Json.Linq; namespace Newtonsoft.Json.Tests.Serialization diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index 2fe19961..1c6e9a9c 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -175,8 +175,10 @@ namespace Newtonsoft.Json.Tests.Serialization serializer.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializer.ConstructorHandling); +#if !NETFX_CORE serializer.Context = new StreamingContext(StreamingContextStates.Other); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializer.Context); +#endif CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); serializer.ContractResolver = resolver; @@ -265,8 +267,10 @@ namespace Newtonsoft.Json.Tests.Serialization settings.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, settings.ConstructorHandling); +#if !NETFX_CORE settings.Context = new StreamingContext(StreamingContextStates.Other); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), settings.Context); +#endif CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); settings.ContractResolver = resolver; @@ -355,8 +359,10 @@ namespace Newtonsoft.Json.Tests.Serialization serializerProxy.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializerProxy.ConstructorHandling); +#if !NETFX_CORE serializerProxy.Context = new StreamingContext(StreamingContextStates.Other); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializerProxy.Context); +#endif CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); serializerProxy.ContractResolver = resolver; diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj index 9f567606..2f51c402 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj @@ -275,6 +275,7 @@ +