-Added additional frameworks to project.json files

This commit is contained in:
James Newton-King
2015-08-22 19:08:40 +12:00
parent 6b02abe20c
commit a9ea63da59
142 changed files with 1090 additions and 222 deletions
+4 -4
View File
@@ -210,8 +210,8 @@ function DnxBuild($build)
{ {
$name = $build.Name $name = $build.Name
exec { dnvm install 1.0.0-beta6 | Out-Default } exec { dnvm install 1.0.0-beta8-15120 -u | Out-Default }
exec { dnvm use 1.0.0-beta6 -r clr | Out-Default } exec { dnvm use 1.0.0-beta8-15120 -r clr | Out-Default }
Write-Host -ForegroundColor Green "Restoring packages for $name" Write-Host -ForegroundColor Green "Restoring packages for $name"
Write-Host Write-Host
@@ -228,7 +228,7 @@ function DnxTests($build)
#Write-Host #Write-Host
#exec { & $toolsDir\Kvm\kvm.ps1 upgrade -r CoreCLR -NoNative | Out-Default } #exec { & $toolsDir\Kvm\kvm.ps1 upgrade -r CoreCLR -NoNative | Out-Default }
exec { dnvm use 1.0.0-beta6 -r coreclr | Out-Default } exec { dnvm use 1.0.0-beta8-15120 -r coreclr | Out-Default }
Write-Host -ForegroundColor Green "Restoring packages for $name" Write-Host -ForegroundColor Green "Restoring packages for $name"
Write-Host Write-Host
@@ -240,7 +240,7 @@ function DnxTests($build)
try try
{ {
Set-Location "$workingSourceDir\Newtonsoft.Json.Tests" Set-Location "$workingSourceDir\Newtonsoft.Json.Tests"
exec { dnx "$workingSourceDir\Newtonsoft.Json.Tests\project.json" --configuration Release test | Out-Default } exec { dnx -p "$workingSourceDir\Newtonsoft.Json.Tests\project.json" --configuration Release test | Out-Default }
} }
finally finally
{ {
-2
View File
@@ -25,9 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -26,10 +26,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Bson; using Newtonsoft.Json.Bson;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
{ {
@@ -26,10 +26,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Bson; using Newtonsoft.Json.Bson;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
{ {
@@ -26,11 +26,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Bson; using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
{ {
@@ -27,15 +27,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if NETFX_CORE #if DNXCORE50
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
using Xunit; using Xunit;
using Test = Xunit.FactAttribute; using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert; using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -43,6 +38,8 @@ using Assert = Newtonsoft.Json.Tests.XUnitAssert;
using NUnit.Framework; using NUnit.Framework;
#endif #endif
#if !(DNXCORE50 || NET20)
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{ {
#region Types #region Types
@@ -484,3 +481,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
} }
} }
} }
#endif
@@ -27,11 +27,18 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
#if !(DNXCORE50 || NET20)
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{ {
@@ -444,3 +451,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
} }
} }
} }
#endif
@@ -26,9 +26,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{ {
@@ -26,14 +26,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
using Xunit; using Xunit;
using Test = Xunit.FactAttribute; using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert; using Assert = Newtonsoft.Json.Tests.XUnitAssert;
@@ -26,9 +26,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -23,13 +23,25 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !DNXCORE50
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
using System.Web; using System.Web;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -85,3 +97,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
} }
} }
} }
#endif
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -24,12 +24,19 @@
#endregion #endregion
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if !NET20
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
[TestFixture] [TestFixture]
@@ -63,3 +70,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
} }
} }
} }
#endif
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -24,7 +24,13 @@
#endregion #endregion
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -26,9 +26,19 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -87,7 +97,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// "CodePlex" // "CodePlex"
// ] // ]
IList<string> categoriesText = categories.Select(c => (string)c).ToList(); string[] categoriesText = categories.Select(c => (string)c).ToArray();
Console.WriteLine(string.Join(", ", categoriesText)); Console.WriteLine(string.Join(", ", categoriesText));
// Json.NET, CodePlex // Json.NET, CodePlex
@@ -25,11 +25,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
using System.Web;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -26,9 +26,19 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -26,9 +26,19 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -24,10 +24,20 @@
#endregion #endregion
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -26,9 +26,19 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -70,13 +80,13 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
] ]
}"); }");
IList<string> storeNames = o.SelectToken("Stores").Select(s => (string)s).ToList(); string[] storeNames = o.SelectToken("Stores").Select(s => (string)s).ToArray();
Console.WriteLine(string.Join(", ", storeNames)); Console.WriteLine(string.Join(", ", storeNames));
// Lambton Quay, Willis Street // Lambton Quay, Willis Street
IList<string> firstProductNames = o["Manufacturers"].Select(m => (string)m.SelectToken("Products[1].Name")) string[] firstProductNames = o["Manufacturers"].Select(m => (string)m.SelectToken("Products[1].Name"))
.Where(n => n != null).ToList(); .Where(n => n != null).ToArray();
Console.WriteLine(string.Join(", ", firstProductNames)); Console.WriteLine(string.Join(", ", firstProductNames));
// Headlight Fluid // Headlight Fluid
@@ -28,9 +28,14 @@ using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -26,10 +26,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -23,13 +23,25 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !DNXCORE50
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Web; using System.Web;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -108,3 +120,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
} }
} }
} }
#endif
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,11 +25,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -25,11 +25,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -28,9 +28,14 @@ using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -26,10 +26,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{ {
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -28,7 +28,6 @@ using Newtonsoft.Json.Schema;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
@@ -25,10 +25,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -26,9 +26,19 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -27,9 +27,16 @@ using Newtonsoft.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
#if !(DNXCORE50 || NET20 || NET35)
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -114,3 +121,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -23,12 +23,19 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !NET20
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -78,3 +85,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -25,15 +25,18 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using Autofac;
using Newtonsoft.Json.Tests.Serialization; using Newtonsoft.Json.Tests.Serialization;
using System.Collections.Immutable;
using Staff = Newtonsoft.Json.Tests.TestObjects.Employee; using Staff = Newtonsoft.Json.Tests.TestObjects.Employee;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -26,9 +26,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,19 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -42,11 +52,11 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
List<string> videogames = JsonConvert.DeserializeObject<List<string>>(json); List<string> videogames = JsonConvert.DeserializeObject<List<string>>(json);
Console.WriteLine(string.Join(", ", videogames)); Console.WriteLine(string.Join(", ", videogames.ToArray()));
// Starcraft, Halo, Legend of Zelda // Starcraft, Halo, Legend of Zelda
#endregion #endregion
Assert.AreEqual("Starcraft, Halo, Legend of Zelda", string.Join(", ", videogames)); Assert.AreEqual("Starcraft, Halo, Legend of Zelda", string.Join(", ", videogames.ToArray()));
} }
} }
} }
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -23,12 +23,19 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !DNXCORE50
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -71,3 +78,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -23,11 +23,18 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !DNXCORE50
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -64,3 +71,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -23,15 +23,21 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using Autofac;
using Newtonsoft.Json.Tests.Serialization; using Newtonsoft.Json.Tests.Serialization;
using System.Collections.Immutable; using System.Collections.Immutable;
@@ -68,3 +74,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -24,11 +24,16 @@
#endregion #endregion
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.Text; using System.Text;
using User = Newtonsoft.Json.Tests.Serialization.MetadataPropertyHandlingTests.User; using User = Newtonsoft.Json.Tests.Serialization.MetadataPropertyHandlingTests.User;
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -23,11 +23,18 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET20 || NET35 || NET40 || DNXCORE50)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -122,3 +129,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
} }
} }
} }
#endif
@@ -26,9 +26,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using File = System.IO.File; using File = System.IO.File;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -26,10 +26,15 @@
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,11 +25,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
using JsonConstructor = Newtonsoft.Json.JsonConstructorAttribute; using JsonConstructor = Newtonsoft.Json.JsonConstructorAttribute;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Collections; using System.Collections;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,19 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq; using System.Linq;
#endif
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -40,7 +50,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
public string Email { get; set; } public string Email { get; set; }
public bool Active { get; set; } public bool Active { get; set; }
public DateTime CreatedDate { get; set; } public DateTime CreatedDate { get; set; }
public IList<string> Roles { get; set; } public List<string> Roles { get; set; }
} }
#endregion #endregion
@@ -75,11 +85,11 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
Console.WriteLine(account.Active); Console.WriteLine(account.Active);
// false // false
Console.WriteLine(string.Join(", ", account.Roles)); Console.WriteLine(string.Join(", ", account.Roles.ToArray()));
// User, Admin, Expired // User, Admin, Expired
#endregion #endregion
Assert.AreEqual("User, Admin, Expired", string.Join(", ", account.Roles)); Assert.AreEqual("User, Admin, Expired", string.Join(", ", account.Roles.ToArray()));
} }
} }
} }
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,10 +25,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {
@@ -25,9 +25,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework; using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{ {

Some files were not shown because too many files have changed in this diff Show More