Beispiel #1
0
        public void TestSerialize()
        {
            TestObject testObject = TestObject.GetTestObject();

            TestObject.Map map = new TestObject.Map();
            ProfileSerializer.Default.RegisterProfile(map);

            MemoryStream stream = new MemoryStream();

            ProfileSerializer.Default.Serialize(stream, testObject);
            byte[] debug = stream.ToArray();
        }
Beispiel #2
0
        public void TestDeserialize()
        {
            TestObject testObject = TestObject.GetTestObject();

            TestObject.Map map = new TestObject.Map();
            ProfileSerializer.Default.RegisterProfile(map);

            MemoryStream stream = new MemoryStream();

            ProfileSerializer.Default.Serialize(stream, testObject);
            stream.Seek(0, SeekOrigin.Begin);

            TestObject deserialized = new TestObject();

            ProfileSerializer.Default.Deserialize(stream, deserialized);
            Assert.Equal(200, deserialized.EmbededObjectA.EmbededObjectB.EmbededPropertyB);
        }