From 56ee111b716b48c3475991df6af08774a9e1495b Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 17 Oct 2013 10:50:02 +1300 Subject: [PATCH] -Updated Sandcastle --- Doc/doc.shfbproj | 94 +++++-------------- .../Properties/AssemblyInfo.cs | 2 +- .../ImmutableCollectionsTests.cs | 22 +++-- .../Serialization/JsonSerializerTest.cs | 34 +++++++ .../Properties/AssemblyInfo.cs | 2 +- 5 files changed, 75 insertions(+), 79 deletions(-) diff --git a/Doc/doc.shfbproj b/Doc/doc.shfbproj index e6649b6fa..4e3d6970b 100644 --- a/Doc/doc.shfbproj +++ b/Doc/doc.shfbproj @@ -32,9 +32,9 @@ Website - .NET Framework 4.0 + .NET Framework 4.5.1 Json.NET - Documentation - vs2005 + VS2005 MemberName ..\Src\Newtonsoft.Json\bin\Release @@ -55,77 +55,35 @@ True API Reference - - - - - - - {@HelpFormatOutputPaths} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {@CachedFrameworkCommentList} - {@CommentFileList} - - - + + {@HelpFormatOutputPaths} + + + + False + OnlyWarningsAndErrors + True + False + False + True + CSharp + Blank + False + en-US + AboveNamespaces + + + + + + + + diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index f58bca614..d015dad32 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -75,4 +75,4 @@ // 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.7.16613")] +[assembly: AssemblyFileVersion("5.0.8.16617")] diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs index 7ec7e7af0..ecb1f9355 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/ImmutableCollectionsTests.cs @@ -84,17 +84,21 @@ public void DeserializeList() public void DeserializeListInterface() { string json = @"[ - ""One"", - ""II"", - ""3"" -]"; + 'Volibear', + 'Teemo', + 'Katarina' + ]"; - IImmutableList l = JsonConvert.DeserializeObject>(json); + // what sorcery is this?! + IImmutableList champions = JsonConvert.DeserializeObject>(json); - Assert.AreEqual(3, l.Count); - Assert.AreEqual("One", l[0]); - Assert.AreEqual("II", l[1]); - Assert.AreEqual("3", l[2]); + Console.WriteLine(champions[0]); + // Volibear + + Assert.AreEqual(3, champions.Count); + Assert.AreEqual("Volibear", champions[0]); + Assert.AreEqual("Teemo", champions[1]); + Assert.AreEqual("Katarina", champions[2]); } #endregion diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index f6be318b5..0feec40ca 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -135,6 +135,40 @@ public class NonGenericClass : GenericClass, string> } + public class CustomerInvoice + { + // we're only modifing the tax rate + public decimal TaxRate { get; set; } + + // everything else gets stored here + [JsonExtensionData] + private IDictionary _additionalData; + } + + [Test] + public void ExtensionDataExample() + { + string json = @"{ + 'HourlyRate': 150, + 'Hours': 40, + 'TaxRate': 0.125 + }"; + + var invoice = JsonConvert.DeserializeObject(json); + + // increase tax to 15% + invoice.TaxRate = 0.15m; + + string result = JsonConvert.SerializeObject(invoice); + // { + // 'TaxRate': 0.15, + // 'HourlyRate': 150, + // 'Hours': 40 + // } + + Assert.AreEqual(@"{""TaxRate"":0.15,""HourlyRate"":150,""Hours"":40}", result); + } + public class ExtensionDataTestClass { public string Name { get; set; } diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 5d0108d5b..546866a26 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -92,6 +92,6 @@ // 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.7.16613")] +[assembly: AssemblyFileVersion("5.0.8.16617")] [assembly: CLSCompliant(true)]