diff --git a/Src/Lib/NUnit/Compact/NUnitLite.dll b/Src/Lib/NUnit/Compact/NUnitLite.dll
deleted file mode 100644
index 2bf15332..00000000
Binary files a/Src/Lib/NUnit/Compact/NUnitLite.dll and /dev/null differ
diff --git a/Src/Lib/NUnit/Silverlight/nunit.framework.dll b/Src/Lib/NUnit/Silverlight/nunit.framework.dll
deleted file mode 100644
index d4e0b72a..00000000
Binary files a/Src/Lib/NUnit/Silverlight/nunit.framework.dll and /dev/null differ
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj
index 685c9f27..4e1717e2 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj
@@ -63,9 +63,9 @@
AllRules.ruleset
-
+
False
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
@@ -96,6 +96,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
index fc27673e..1e4a6bbd 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj
@@ -65,9 +65,9 @@
AllRules.ruleset
-
+
False
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
@@ -138,6 +138,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
index 5278360a..644e137e 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj
@@ -67,9 +67,9 @@
-
+
False
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
@@ -256,6 +256,7 @@
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
index 96a96143..f7188a3a 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj
@@ -68,11 +68,13 @@
-
- False
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
+
+ ..\packages\Microsoft.Bcl.Immutable.1.0.12-beta\lib\portable-net45+win8+wp8\System.Collections.Immutable.dll
+
3.5
@@ -137,6 +139,7 @@
+
@@ -149,9 +152,7 @@
-
- Component
-
+
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
index 53bd1940..4176c8b3 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj
@@ -68,9 +68,9 @@
-
+
False
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
index 25baf467..79905512 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
@@ -30,10 +30,14 @@
4
-
- ..\Lib\NUnit\DotNet\nunit.framework.dll
+
+ False
+ ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
+
+ ..\packages\Microsoft.Bcl.Immutable.1.0.12-beta\lib\portable-net45+win8+wp8\System.Collections.Immutable.dll
+
@@ -226,6 +230,7 @@
+
@@ -355,6 +360,7 @@
LinqToSqlClasses.designer.cs
Designer
+
Always
diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
index 71b35dec..fbd680f5 100644
--- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
@@ -75,4 +75,4 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
-[assembly: AssemblyFileVersion("5.0.6.16207")]
+[assembly: AssemblyFileVersion("5.0.6.16308")]
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs
new file mode 100644
index 00000000..d3f189c5
--- /dev/null
+++ b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs
@@ -0,0 +1,424 @@
+#region License
+// Copyright (c) 2007 James Newton-King
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+#endregion
+
+#if !(NET20 || NET35 || NET40 || PORTABLE40)
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NUnit.Framework;
+using Newtonsoft.Json.Linq;
+
+namespace Newtonsoft.Json.Tests.Serialization
+{
+ [TestFixture]
+ public class ImmutableCollectionsTests : TestFixtureBase
+ {
+ #region List
+ [Test]
+ public void SerializeList()
+ {
+ ImmutableList l = ImmutableList.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"[
+ ""One"",
+ ""II"",
+ ""3""
+]", json);
+ }
+
+ [Test]
+ public void DeserializeList()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableList l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count);
+ Assert.AreEqual("One", l[0]);
+ Assert.AreEqual("II", l[1]);
+ Assert.AreEqual("3", l[2]);
+ }
+
+ [Test]
+ public void DeserializeListInterface()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ IImmutableList l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count);
+ Assert.AreEqual("One", l[0]);
+ Assert.AreEqual("II", l[1]);
+ Assert.AreEqual("3", l[2]);
+ }
+ #endregion
+
+ #region Array
+ [Test]
+ public void SerializeArray()
+ {
+ ImmutableArray l = ImmutableArray.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"[
+ ""One"",
+ ""II"",
+ ""3""
+]", json);
+ }
+
+ [Test]
+ public void DeserializeArray()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableArray l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Length);
+ Assert.AreEqual("One", l[0]);
+ Assert.AreEqual("II", l[1]);
+ Assert.AreEqual("3", l[2]);
+ }
+ #endregion
+
+ #region Queue
+ [Test]
+ public void SerializeQueue()
+ {
+ ImmutableQueue l = ImmutableQueue.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"[
+ ""One"",
+ ""II"",
+ ""3""
+]", json);
+ }
+
+ [Test]
+ public void DeserializeQueue()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableQueue l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.AreEqual("One", l.ElementAt(0));
+ Assert.AreEqual("II", l.ElementAt(1));
+ Assert.AreEqual("3", l.ElementAt(2));
+ }
+
+ [Test]
+ public void DeserializeQueueInterface()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ IImmutableQueue l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.AreEqual("One", l.ElementAt(0));
+ Assert.AreEqual("II", l.ElementAt(1));
+ Assert.AreEqual("3", l.ElementAt(2));
+ }
+ #endregion
+
+ #region Stack
+ [Test]
+ public void SerializeStack()
+ {
+ ImmutableStack l = ImmutableStack.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"[
+ ""3"",
+ ""II"",
+ ""One""
+]", json);
+ }
+
+ [Test]
+ public void DeserializeStack()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableStack l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.AreEqual("3", l.ElementAt(0));
+ Assert.AreEqual("II", l.ElementAt(1));
+ Assert.AreEqual("One", l.ElementAt(2));
+ }
+
+ [Test]
+ public void DeserializeStackInterface()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ IImmutableStack l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.AreEqual("3", l.ElementAt(0));
+ Assert.AreEqual("II", l.ElementAt(1));
+ Assert.AreEqual("One", l.ElementAt(2));
+ }
+ #endregion
+
+ #region HashSet
+ [Test]
+ public void SerializeHashSet()
+ {
+ ImmutableHashSet l = ImmutableHashSet.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+
+ JArray a = JArray.Parse(json);
+ Assert.AreEqual(3, a.Count);
+ Assert.IsTrue(a.Any(t => t.DeepEquals("One")));
+ Assert.IsTrue(a.Any(t => t.DeepEquals("II")));
+ Assert.IsTrue(a.Any(t => t.DeepEquals("3")));
+ }
+
+ [Test]
+ public void DeserializeHashSet()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableHashSet l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.IsTrue(l.Contains("3"));
+ Assert.IsTrue(l.Contains("II"));
+ Assert.IsTrue(l.Contains("One"));
+ }
+
+ [Test]
+ public void DeserializeHashSetInterface()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ IImmutableSet l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.IsTrue(l.Contains("3"));
+ Assert.IsTrue(l.Contains("II"));
+ Assert.IsTrue(l.Contains("One"));
+ }
+ #endregion
+
+ #region SortedSet
+ [Test]
+ public void SerializeSortedSet()
+ {
+ ImmutableSortedSet l = ImmutableSortedSet.From(new List
+ {
+ "One",
+ "II",
+ "3"
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"[
+ ""3"",
+ ""II"",
+ ""One""
+]", json);
+ }
+
+ [Test]
+ public void DeserializeSortedSet()
+ {
+ string json = @"[
+ ""One"",
+ ""II"",
+ ""3""
+]";
+
+ ImmutableSortedSet l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count());
+ Assert.IsTrue(l.Contains("3"));
+ Assert.IsTrue(l.Contains("II"));
+ Assert.IsTrue(l.Contains("One"));
+ }
+ #endregion
+
+ #region Dictionary
+ [Test]
+ public void SerializeDictionary()
+ {
+ ImmutableDictionary l = ImmutableDictionary.Create(new Dictionary
+ {
+ {1, "One"},
+ {2, "II"},
+ {3, "3"}
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ JObject a = JObject.Parse(json);
+ Assert.AreEqual(3, a.Count);
+ Assert.AreEqual("One", (string)a["1"]);
+ Assert.AreEqual("II", (string)a["2"]);
+ Assert.AreEqual("3", (string)a["3"]);
+ }
+
+ [Test]
+ public void DeserializeDictionary()
+ {
+ string json = @"{
+ ""1"": ""One"",
+ ""2"": ""II"",
+ ""3"": ""3""
+}";
+
+ ImmutableDictionary l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count);
+ Assert.AreEqual("One", l[1]);
+ Assert.AreEqual("II", l[2]);
+ Assert.AreEqual("3", l[3]);
+ }
+
+ [Test]
+ public void DeserializeDictionaryInterface()
+ {
+ string json = @"{
+ ""1"": ""One"",
+ ""2"": ""II"",
+ ""3"": ""3""
+}";
+
+ IImmutableDictionary l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count);
+ Assert.AreEqual("One", l[1]);
+ Assert.AreEqual("II", l[2]);
+ Assert.AreEqual("3", l[3]);
+ }
+ #endregion
+
+ #region SortedDictionary
+ [Test]
+ public void SerializeSortedDictionary()
+ {
+ ImmutableSortedDictionary l = ImmutableSortedDictionary.Create(new SortedDictionary
+ {
+ {1, "One"},
+ {2, "II"},
+ {3, "3"}
+ });
+
+ string json = JsonConvert.SerializeObject(l, Formatting.Indented);
+ Assert.AreEqual(@"{
+ ""1"": ""One"",
+ ""2"": ""II"",
+ ""3"": ""3""
+}", json);
+ }
+
+ [Test]
+ public void DeserializeSortedDictionary()
+ {
+ string json = @"{
+ ""1"": ""One"",
+ ""2"": ""II"",
+ ""3"": ""3""
+}";
+
+ ImmutableSortedDictionary l = JsonConvert.DeserializeObject>(json);
+
+ Assert.AreEqual(3, l.Count);
+ Assert.AreEqual("One", l[1]);
+ Assert.AreEqual("II", l[2]);
+ Assert.AreEqual("3", l[3]);
+ }
+ #endregion
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj
index 99649409..5425fea1 100644
--- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj
+++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj
@@ -122,6 +122,7 @@
+
diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj
index f6c8d994..5ecceb04 100644
--- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj
+++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj
@@ -5,7 +5,7 @@
AnyCPU
9.0.30729
2.0
- {B70AD007-4437-44C2-A25A-6D5AE41691F9}
+ {A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}
Library
Properties
Newtonsoft.Json
@@ -232,6 +232,7 @@
+
diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj
index 943b43de..5051da43 100644
--- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj
+++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj
@@ -231,6 +231,7 @@
+
diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj
index 20268cd6..bbe8d0cb 100644
--- a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj
+++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj
@@ -207,6 +207,7 @@
+
diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj
index efa64569..9c579193 100644
--- a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj
+++ b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj
@@ -208,6 +208,7 @@
+
diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
index 8771a5ee..a977c2ab 100644
--- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
@@ -92,6 +92,6 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
-[assembly: AssemblyFileVersion("5.0.6.16207")]
+[assembly: AssemblyFileVersion("5.0.6.16308")]
[assembly: CLSCompliant(true)]
diff --git a/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs b/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
index af7e4f79..dee86696 100644
--- a/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
+++ b/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Serialization
internal bool ShouldCreateWrapper { get; private set; }
internal bool CanDeserialize { get; private set; }
- internal ConstructorInfo ParametrizedConstructor { get; private set; }
+ internal MethodBase ParametrizedConstructor { get; private set; }
///
/// Initializes a new instance of the class.
@@ -95,8 +95,8 @@ namespace Newtonsoft.Json.Serialization
else
CollectionItemType = ReflectionUtils.GetCollectionItemType(underlyingType);
- if (underlyingType == typeof (IList))
- CreatedType = typeof (List