-Fixed WinRT build

This commit is contained in:
James Newton-King
2013-07-09 10:35:41 +12:00
parent 423d065c8f
commit 4f3f9d06eb
4 changed files with 19 additions and 0 deletions
@@ -164,6 +164,7 @@
<Compile Include="Serialization\DefaultValueHandlingTests.cs" /> <Compile Include="Serialization\DefaultValueHandlingTests.cs" />
<Compile Include="Serialization\DynamicTests.cs" /> <Compile Include="Serialization\DynamicTests.cs" />
<Compile Include="Serialization\EntitiesSerializationTests.cs" /> <Compile Include="Serialization\EntitiesSerializationTests.cs" />
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" /> <Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerTest.cs" /> <Compile Include="Serialization\JsonSerializerTest.cs" />
<Compile Include="Serialization\MissingMemberHandlingTests.cs" /> <Compile Include="Serialization\MissingMemberHandlingTests.cs" />
@@ -314,6 +315,11 @@
<ItemGroup> <ItemGroup>
<None Include="Newtonsoft.Json.Tests.WinRT_TemporaryKey.pfx" /> <None Include="Newtonsoft.Json.Tests.WinRT_TemporaryKey.pfx" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System.Collections.Immutable">
<HintPath>..\packages\Microsoft.Bcl.Immutable.1.0.12-beta\lib\portable-net45+win8+wp8\System.Collections.Immutable.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' "> <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' ">
<VisualStudioVersion>11.0</VisualStudioVersion> <VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup> </PropertyGroup>
@@ -30,7 +30,13 @@ using System.Collections.Immutable;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
#if !NETFX_CORE
using NUnit.Framework; 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; using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Serialization namespace Newtonsoft.Json.Tests.Serialization
@@ -175,8 +175,10 @@ namespace Newtonsoft.Json.Tests.Serialization
serializer.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; serializer.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializer.ConstructorHandling); Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializer.ConstructorHandling);
#if !NETFX_CORE
serializer.Context = new StreamingContext(StreamingContextStates.Other); serializer.Context = new StreamingContext(StreamingContextStates.Other);
Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializer.Context); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializer.Context);
#endif
CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver();
serializer.ContractResolver = resolver; serializer.ContractResolver = resolver;
@@ -265,8 +267,10 @@ namespace Newtonsoft.Json.Tests.Serialization
settings.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; settings.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, settings.ConstructorHandling); Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, settings.ConstructorHandling);
#if !NETFX_CORE
settings.Context = new StreamingContext(StreamingContextStates.Other); settings.Context = new StreamingContext(StreamingContextStates.Other);
Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), settings.Context); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), settings.Context);
#endif
CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver();
settings.ContractResolver = resolver; settings.ContractResolver = resolver;
@@ -355,8 +359,10 @@ namespace Newtonsoft.Json.Tests.Serialization
serializerProxy.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor; serializerProxy.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializerProxy.ConstructorHandling); Assert.AreEqual(ConstructorHandling.AllowNonPublicDefaultConstructor, serializerProxy.ConstructorHandling);
#if !NETFX_CORE
serializerProxy.Context = new StreamingContext(StreamingContextStates.Other); serializerProxy.Context = new StreamingContext(StreamingContextStates.Other);
Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializerProxy.Context); Assert.AreEqual(new StreamingContext(StreamingContextStates.Other), serializerProxy.Context);
#endif
CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver(); CamelCasePropertyNamesContractResolver resolver = new CamelCasePropertyNamesContractResolver();
serializerProxy.ContractResolver = resolver; serializerProxy.ContractResolver = resolver;
@@ -275,6 +275,7 @@
<Compile Include="Utilities\EnumValues.cs" /> <Compile Include="Utilities\EnumValues.cs" />
<Compile Include="Utilities\ExpressionReflectionDelegateFactory.cs" /> <Compile Include="Utilities\ExpressionReflectionDelegateFactory.cs" />
<Compile Include="Utilities\ILGeneratorExtensions.cs" /> <Compile Include="Utilities\ILGeneratorExtensions.cs" />
<Compile Include="Utilities\ImmutableCollectionsUtils.cs" />
<Compile Include="Utilities\JavaScriptUtils.cs" /> <Compile Include="Utilities\JavaScriptUtils.cs" />
<Compile Include="Utilities\LateBoundReflectionDelegateFactory.cs" /> <Compile Include="Utilities\LateBoundReflectionDelegateFactory.cs" />
<Compile Include="Utilities\LinqBridge.cs" /> <Compile Include="Utilities\LinqBridge.cs" />