public void Deserialize_object_properly()
            {
                var test = CreateSampleTestData();
                var obj  = CreateSerializedObject(test);

                Console.WriteLine(new ArraySegment <byte>(obj.GetBuffer(), 0, (int)obj.Length).ToBinaryString());

                var serializer = new ProtoBufStacksSerializer();
                var data       = serializer.Deserialize <TestData>(obj);

                Assert.Equal(test.Bar, data.Bar);
                Assert.Equal(test.Foo, data.Foo);
                Assert.Equal(test.Sar, data.Sar);
                Assert.Equal(test.Zar, data.Zar);
            }
            public void Serialize_data_so_it_can_be_later_deserialized_with_Deserialize()
            {
                var test = CreateSampleTestData();

                var serializer = new ProtoBufStacksSerializer();
                var ms         = new MemoryStream();

                serializer.Serialize(test, ms);
                ms.Position = 0;
                var data = serializer.Deserialize <TestData>(ms);

                Assert.Equal(test.Bar, data.Bar);
                Assert.Equal(test.Foo, data.Foo);
                Assert.Equal(test.Sar, data.Sar);
                Assert.Equal(test.Zar, data.Zar);
            }