Exemplo n.º 1
0
        public void CallbacksGetCalled()
        {
            TypeWithCallbacks o = new TypeWithCallbacks();

            string json = Serialize(o, typeof(TypeWithCallbacks));

            Assert.Equal("12", o.callbackOrder);

            TypeWithCallbacks deserializedObject = Deserialize(json, typeof(TypeWithCallbacks)) as TypeWithCallbacks;

            Assert.Equal("34", deserializedObject.callbackOrder);
        }
        public async Task CallbacksGetCalled()
        {
            TypeWithCallbacks o = new TypeWithCallbacks();

            string json = await SerializeAsync(o, typeof(TypeWithCallbacks));

            Assert.Equal("12", o.callbackOrder);

            TypeWithCallbacks deserializedObject = (await DeserializeAsync(json, typeof(TypeWithCallbacks))) as TypeWithCallbacks;

            Assert.Equal("34", deserializedObject.callbackOrder);
        }