diff options
author | csharptest <roger@csharptest.net> | 2011-05-19 12:01:16 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2011-05-19 12:01:16 -0500 |
commit | f1816beebe7f68a6e9380b964d93c1dee91fb277 (patch) | |
tree | c03f8e2d549a7ed71e243a1437085b9d7c976f42 /src/ProtocolBuffers.Test/DescriptorsTest.cs | |
parent | 68d831e3a48ea3a81b3791a24219bc3406b962b8 (diff) | |
download | protobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.tar.gz protobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.tar.bz2 protobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.zip |
- Added CSharpServiceType NONE to skip service generation.
- Defaulted service_generator_type to NONE
- Added /protos/extest/unittest_generic_services.proto to test services
- Migrated unit tests to use the new generic services for testing
Diffstat (limited to 'src/ProtocolBuffers.Test/DescriptorsTest.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/DescriptorsTest.cs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ProtocolBuffers.Test/DescriptorsTest.cs b/src/ProtocolBuffers.Test/DescriptorsTest.cs index c5223f9f..f3c03cd6 100644 --- a/src/ProtocolBuffers.Test/DescriptorsTest.cs +++ b/src/ProtocolBuffers.Test/DescriptorsTest.cs @@ -75,13 +75,13 @@ namespace Google.ProtocolBuffers { Assert.AreEqual("ImportEnum", UnitTestImportProtoFile.Descriptor.EnumTypes[0].Name); for (int i = 0; i < file.EnumTypes.Count; i++) { Assert.AreEqual(i, file.EnumTypes[i].Index); - } - - ServiceDescriptor service = TestService.Descriptor; - Assert.AreEqual(service, file.Services[0]); - Assert.AreEqual(service, file.FindTypeByName<ServiceDescriptor>("TestService")); - Assert.IsNull(file.FindTypeByName<ServiceDescriptor>("NoSuchType")); - Assert.IsNull(file.FindTypeByName<ServiceDescriptor>("protobuf_unittest.TestService")); + }
+
+ ServiceDescriptor service = TestGenericService.Descriptor; + Assert.AreEqual(service, UnitTestGenericServices.Descriptor.Services[0]);
+ Assert.AreEqual(service, UnitTestGenericServices.Descriptor.FindTypeByName<ServiceDescriptor>("TestGenericService"));
+ Assert.IsNull(UnitTestGenericServices.Descriptor.FindTypeByName<ServiceDescriptor>("NoSuchType"));
+ Assert.IsNull(UnitTestGenericServices.Descriptor.FindTypeByName<ServiceDescriptor>("protobuf_unittest.TestGenericService")); Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Services.Count); for (int i = 0; i < file.Services.Count; i++) { Assert.AreEqual(i, file.Services[i].Index); @@ -261,11 +261,11 @@ namespace Google.ProtocolBuffers { [Test] public void ServiceDescriptor() { - ServiceDescriptor service = TestService.Descriptor; - - Assert.AreEqual("TestService", service.Name); - Assert.AreEqual("protobuf_unittest.TestService", service.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, service.File); + ServiceDescriptor service = TestGenericService.Descriptor;
+
+ Assert.AreEqual("TestGenericService", service.Name);
+ Assert.AreEqual("protobuf_unittest.TestGenericService", service.FullName);
+ Assert.AreEqual(UnitTestGenericServices.Descriptor, service.File); Assert.AreEqual(2, service.Methods.Count); @@ -310,9 +310,9 @@ namespace Google.ProtocolBuffers { enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)); Assert.AreEqual(Integer.valueOf(-789), enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)); - */ - - ServiceDescriptor service = TestServiceWithCustomOptions.Descriptor; + */
+
+ ServiceDescriptor service = TestGenericServiceWithCustomOptions.Descriptor; Assert.IsTrue(service.Options.HasExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); Assert.AreEqual(-9876543210L, service.Options.GetExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); |