Ejemplo n.º 1
0
        public void AlreadyReceivedExceptionSerializable()
        {
            var exc = new AlreadyReceivedException("for testing");

            var formatter = new BinaryFormatter();

            using (var ms = new MemoryStream())
            {
                formatter.Serialize(ms, exc);

                ms.Seek(0, SeekOrigin.Begin);
                var deserialized = (AlreadyReceivedException)formatter.Deserialize(ms);
                Assert.Equal("for testing", deserialized.Message);
            }
        }
Ejemplo n.º 2
0
        public void AlreadyReceivedExceptionSerializable()
        {
            var exc = new AlreadyReceivedException("for testing");

            AssertException <AlreadyReceivedException>(exc);
        }