Example #1
0
        public void DynamicMessageAccessors()
        {
            IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);

            reflectionTester.SetAllFieldsViaReflection(builder);
            IMessage message = builder.WeakBuild();

            reflectionTester.AssertAllFieldsSetViaReflection(message);
        }
        public void ExtensionReflectionGetters()
        {
            TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder();
            TestUtil.SetAllExtensions(builder);
            TestAllExtensions message = builder.Build();

            extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
        }
        public void ReflectionGetters()
        {
            TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
            TestUtil.SetAllFields(builder);
            TestAllTypes message = builder.Build();

            reflectionTester.AssertAllFieldsSetViaReflection(message);
        }
Example #4
0
        public void DynamicMessageExtensionAccessors()
        {
            // We don't need to extensively test DynamicMessage's handling of
            // extensions because, frankly, it doesn't do anything special with them.
            // It treats them just like any other fields.
            IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor);

            extensionsReflectionTester.SetAllFieldsViaReflection(builder);
            IMessage message = builder.WeakBuild();

            extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
        }