-Added JsonPrimitiveContract and JsonLinqContract

-Removed JsonRaw and replaced with JRaw
-Fixed properties on existing derived values not being populated during deserialization
This commit is contained in:
JamesNK
2009-12-27 03:30:43 +00:00
parent 9144bc6c80
commit 961945657a
35 changed files with 835 additions and 436 deletions
@@ -30,6 +30,7 @@ using System.Linq;
using System.Text;
using Newtonsoft.Json.Tests.TestObjects;
using NUnit.Framework;
using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Serialization
{
@@ -131,5 +132,12 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(1, p.Count);
Assert.AreEqual("James", p["Name"]);
}
[Test]
[ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unexpected initial token 'Integer' when populating object. Expected JSON object or array.")]
public void PopulateWithBadJson()
{
JsonConvert.PopulateObject("1", new Person());
}
}
}