Akka.Interfaced.ProtobufSerializer.Tests.SerializeExceptionTest.TestTypeAliasException C# (CSharp) Method

TestTypeAliasException() private method

private TestTypeAliasException ( ) : void
return void
        public void TestTypeAliasException()
        {
            var serializer = new ProtobufSerializer(null);

            var exception = new TestException { ErrorCode = 1000, ErrorDetail = "Test" };
            var obj = new ResponseMessage { Exception = exception };
            var bytes = serializer.ToBinary(obj);

            var obj2 = (ResponseMessage)serializer.FromBinary(bytes, null);
            Assert.Equal(obj.Exception.GetType(), obj2.Exception.GetType());

            var exception2 = (TestException)obj2.Exception;
            Assert.Equal(exception.ErrorCode, exception2.ErrorCode);
            Assert.Equal(exception.ErrorDetail, exception2.ErrorDetail);
        }
    }