-Added missing XML documentation

-Fixed potential null reference error when getting attributes
-Performance documentation
This commit is contained in:
James Newton-King
2012-10-27 19:25:04 +13:00
parent 0e4611ed86
commit 1fa5e4a22e
14 changed files with 459 additions and 13 deletions
@@ -46,6 +46,33 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture]
public class DefaultValueHandlingTests : TestFixtureBase
{
[Test]
public void Include()
{
Invoice invoice = new Invoice
{
Company = "Acme Ltd.",
Amount = 50.0m,
Paid = false,
FollowUpDays = 30,
FollowUpEmailAddress = string.Empty,
PaidDate = null
};
string included = JsonConvert.SerializeObject(invoice,
Formatting.Indented,
new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Include });
Assert.AreEqual(@"{
""Company"": ""Acme Ltd."",
""Amount"": 50.0,
""Paid"": false,
""PaidDate"": null,
""FollowUpDays"": 30,
""FollowUpEmailAddress"": """"
}", included);
}
[Test]
public void SerializeInvoice()
{