示例#1
0
        public void JsonSerializer_Serialize_hooks_on_base_class()
        {
            var original = new HookTestClass();
            var json     = JsonSerializer.SerializeToString <HookTestClass>(original);

            Assert.That(original.OnSerializedTouched, Is.True);
            Assert.That(original.OnSerializingTouched, Is.True);
        }
示例#2
0
        public void JsonSerializer_Deserialize_hooks_on_base_class()
        {
            var original = new HookTestClass();

            var json         = JsonSerializer.SerializeToString <HookTestClass>(original);
            var deserialized = JsonSerializer.DeserializeFromString <HookTestClass>(json);

            Assert.That(deserialized.OnDeserializedTouched, Is.True);
        }