public void Can_serialize_email_dto()
        {
            using (var ms = new MemoryStream())
            {
                WireFormat.Serialize(request, ms);

                ms.Position = 0;

                var response = WireFormat.Deserialize(request.GetType(), ms);

                Assert.That(response.Equals(request));
            }
        }
Ejemplo n.º 2
0
        public void Can_serialize_email_dto()
        {
            using (var ms = new MemoryStream())
            {
                var serializer = MessagePackSerializer.Get(request.GetType());
                serializer.PackTo(Packer.Create(ms), request);

                ms.Position = 0;

                var unpacker = Unpacker.Create(ms);
                unpacker.Read();
                var response = serializer.UnpackFrom(unpacker);

                Assert.That(response.Equals(request));
            }
        }