diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj index fecfd9a4..0853b2e3 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WinRT.csproj @@ -167,6 +167,8 @@ + + @@ -180,6 +182,7 @@ + diff --git a/Src/Newtonsoft.Json.Tests/Serialization/DependencyInjectionTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/DependencyInjectionTests.cs index 9b8bd106..7590a785 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/DependencyInjectionTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/DependencyInjectionTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(NET40 || NET35 || NET20 || ASPNETCORE50 || PORTABLE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || ASPNETCORE50 || PORTABLE || PORTABLE40 || NETFX_CORE) using Autofac; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Tests.TestObjects; diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ExtensionDataTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ExtensionDataTests.cs index 24cee043..4da7c9a2 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/ExtensionDataTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/ExtensionDataTests.cs @@ -724,7 +724,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual(2, (int)c.ExtensionData0["second"]); } - public class Test + public class TestClass { [JsonProperty("LastActivityDate")] public DateTime? LastActivityDate { get; set; } @@ -738,7 +738,7 @@ namespace Newtonsoft.Json.Tests.Serialization { string json = @"{ ""LastActivityDate"":null, ""CustomField1"":""Testing"" }"; - var c = JsonConvert.DeserializeObject(json); + var c = JsonConvert.DeserializeObject(json); Assert.AreEqual(null, c.LastActivityDate); Assert.AreEqual(1, c.CustomFields.Count); diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerCollectionsTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerCollectionsTests.cs index 72bc6a8b..d19ae72e 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerCollectionsTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerCollectionsTests.cs @@ -58,6 +58,7 @@ namespace Newtonsoft.Json.Tests.Serialization [TestFixture] public class JsonSerializerCollectionsTests : TestFixtureBase { +#if !NETFX_CORE public class NameValueCollectionTestClass { public NameValueCollection Collection { get; set; } @@ -70,6 +71,7 @@ namespace Newtonsoft.Json.Tests.Serialization () => JsonConvert.DeserializeObject("{Collection:[]}"), "Cannot create and populate list type System.Collections.Specialized.NameValueCollection. Path 'Collection', line 1, position 13."); } +#endif [Test] public void MultiDObjectArray() diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index 40256c57..e4c43e83 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -8588,6 +8588,7 @@ Path '', line 1, position 1."); Assert.AreEqual("derived", d.DerivedProperty); } +#if !NETFX_CORE [Test] public void MailMessageConverterTest() { @@ -8732,6 +8733,7 @@ Path '', line 1, position 1."); throw new NotImplementedException(); } } +#endif } public class DerivedWithPrivate : BaseWithPrivate diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ReflectionAttributeProviderTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ReflectionAttributeProviderTests.cs index 26411e53..668fcc90 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/ReflectionAttributeProviderTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/ReflectionAttributeProviderTests.cs @@ -31,7 +31,18 @@ using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Tests.TestObjects; +using Newtonsoft.Json.Utilities; +#if NETFX_CORE +using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; +using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; +using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; +#elif ASPNETCORE50 +using Xunit; +using Test = Xunit.FactAttribute; +using Assert = Newtonsoft.Json.Tests.XUnitAssert; +#else using NUnit.Framework; +#endif namespace Newtonsoft.Json.Tests.Serialization { @@ -75,7 +86,7 @@ namespace Newtonsoft.Json.Tests.Serialization [Test] public void GetAttributes_Field() { - FieldInfo field = typeof(ReflectionTestObject).GetField("TestField"); + FieldInfo field = (FieldInfo)typeof(ReflectionTestObject).GetField("TestField"); ReflectionAttributeProvider provider = new ReflectionAttributeProvider(field); diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj index 9918d4d8..0a7acf63 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.WinRT.csproj @@ -235,6 +235,7 @@ + @@ -259,6 +260,7 @@ +