diff options
author | JamesNK <james@newtonking.com> | 2011-07-04 13:16:23 +0400 |
---|---|---|
committer | JamesNK <james@newtonking.com> | 2011-07-04 13:16:23 +0400 |
commit | c1cafd078d00c9da96f5510105ccb0ee269a5f53 (patch) | |
tree | 7f613bd959b1a5e50206a8456780f809d1e90d1f /Src/Newtonsoft.Json.Tests | |
parent | b607b40753984bee86ac87a941eafe18535d0bbe (diff) |
-Added serialization constructors to all Exceptions
-Added support for serialization event attributes on base classes
-Changed WriteEndObject, WriteEndArray, WriteEndConstructor on JsonWriter to be virtual
Diffstat (limited to 'Src/Newtonsoft.Json.Tests')
-rw-r--r-- | Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs | 2 | ||||
-rw-r--r-- | Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index 95dd4f8..800165e 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.2.0")]
#if !PocketPC
-[assembly: AssemblyFileVersion("4.0.2.13825")]
+[assembly: AssemblyFileVersion("4.0.2.13904")]
#endif
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs index 1041002..ed50d15 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs @@ -232,6 +232,32 @@ namespace Newtonsoft.Json.Tests.Serialization // This value was set after deserialization.
}
+ public class SerializationEventBaseTestObject
+ {
+ public string TestMember { get; set; }
+
+ [OnSerializing]
+ internal void OnSerializingMethod(StreamingContext context)
+ {
+ TestMember = "Set!";
+ }
+ }
+
+ public class SerializationEventContextSubClassTestObject : SerializationEventBaseTestObject
+ {
+ }
+
+ [Test]
+ public void SerializationEventContextTestObjectSubClassTest()
+ {
+ SerializationEventContextSubClassTestObject obj = new SerializationEventContextSubClassTestObject();
+
+ string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
+ Assert.AreEqual(@"{
+ ""TestMember"": ""Set!""
+}", json);
+ }
+
#if !SILVERLIGHT
public class SerializationEventContextTestObject
{
|