Example #1
0
        public void RoundTrip_NestedExtensionGroup()
        {
            var message = new TestGroupExtension();

            message.SetExtension(TestNestedExtension.Extensions.OptionalGroupExtension, new TestNestedExtension.Types.OptionalGroup_extension {
                A = 10
            });

            MessageParsingHelpers.AssertRoundtrip(
                TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry()
            {
                TestNestedExtension.Extensions.OptionalGroupExtension
            }),
                message);
        }
        public void RoundTrip_NestedExtensionGroup()
        {
            var message = new TestGroupExtension();

            message.SetExtension(TestNestedExtension.Extensions.OptionalGroupExtension, new TestNestedExtension.Types.OptionalGroup_extension {
                A = 10
            });

            byte[]             bytes             = message.ToByteArray();
            TestGroupExtension extendable_parsed = TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry()
            {
                TestNestedExtension.Extensions.OptionalGroupExtension
            }).ParseFrom(bytes);

            Assert.AreEqual(message, extendable_parsed);
        }