diff options
Diffstat (limited to 'src/ProtocolBuffers.Test/GeneratedMessageTest.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/GeneratedMessageTest.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/src/ProtocolBuffers.Test/GeneratedMessageTest.cs index ecf07b6a..3abf5bff 100644 --- a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs +++ b/src/ProtocolBuffers.Test/GeneratedMessageTest.cs @@ -397,5 +397,32 @@ namespace Google.ProtocolBuffers { TestAllTypes message = builder.Build(); TestUtil.AssertAllFieldsSet(message.ToBuilder().Build()); } + + [Test] + public void FieldConstantValues() { + Assert.AreEqual(TestAllTypes.Types.NestedMessage.BbFieldNumber, 1); + Assert.AreEqual(TestAllTypes.OptionalInt32FieldNumber, 1); + Assert.AreEqual(TestAllTypes.OptionalGroupFieldNumber, 16); + Assert.AreEqual(TestAllTypes.OptionalNestedMessageFieldNumber, 18); + Assert.AreEqual(TestAllTypes.OptionalNestedEnumFieldNumber, 21); + Assert.AreEqual(TestAllTypes.RepeatedInt32FieldNumber, 31); + Assert.AreEqual(TestAllTypes.RepeatedGroupFieldNumber, 46); + Assert.AreEqual(TestAllTypes.RepeatedNestedMessageFieldNumber, 48); + Assert.AreEqual(TestAllTypes.RepeatedNestedEnumFieldNumber, 51); + } + + [Test] + public void ExtensionConstantValues() { + Assert.AreEqual(TestRequired.SingleFieldNumber, 1000); + Assert.AreEqual(TestRequired.MultiFieldNumber, 1001); + Assert.AreEqual(UnitTestProtoFile.OptionalInt32ExtensionFieldNumber, 1); + Assert.AreEqual(UnitTestProtoFile.OptionalGroupExtensionFieldNumber, 16); + Assert.AreEqual(UnitTestProtoFile.OptionalNestedMessageExtensionFieldNumber, 18); + Assert.AreEqual(UnitTestProtoFile.OptionalNestedEnumExtensionFieldNumber, 21); + Assert.AreEqual(UnitTestProtoFile.RepeatedInt32ExtensionFieldNumber, 31); + Assert.AreEqual(UnitTestProtoFile.RepeatedGroupExtensionFieldNumber, 46); + Assert.AreEqual(UnitTestProtoFile.RepeatedNestedMessageExtensionFieldNumber, 48); + Assert.AreEqual(UnitTestProtoFile.RepeatedNestedEnumExtensionFieldNumber, 51); + } } } |