diff options
author | Jon Skeet <jonskeet@google.com> | 2015-04-28 15:06:59 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-04-28 15:06:59 +0100 |
commit | ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5 (patch) | |
tree | 84adc050b8ee575f94a5efc13322dd7d344fcff7 /csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs | |
parent | f3504cf3b1d456a843e8242fdee9ba0bf2991dc1 (diff) | |
download | protobuf-ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5.tar.gz protobuf-ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5.tar.bz2 protobuf-ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5.zip |
Updated set of unit tests and unit test protos.
This commit includes changes to the C#-specific protos, and rebuilt versions of the "stock" protos.
The stock protos have been locally updated to have a specific C# namespace, but this is expected to change soon, so hasn't been committed.
Four areas are currently not tested:
1) Serialization - we may restore this at some point, possibly optionally.
2) Services - currently nothing is generated for this; will need to see how it interacts with GRPC
3) Fields beginning with _{digit} - see https://github.com/google/protobuf/issues/308
4) Fields with names which conflict with the declaring type in nasty ways - see https://github.com/google/protobuf/issues/309
Diffstat (limited to 'csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs')
-rw-r--r-- | csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs index 66791afb..f3a7789e 100644 --- a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs @@ -113,7 +113,7 @@ namespace Google.ProtocolBuffers {
TestAllExtensionsLite copy,
msg = TestAllExtensionsLite.CreateBuilder()
- .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite,
+ .SetExtension(UnittestLite.OptionalStringExtensionLite,
"Should be merged.").Build();
copy = TestAllExtensionsLite.DefaultInstance;
@@ -124,11 +124,11 @@ namespace Google.ProtocolBuffers s.Position = 0;
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestLiteProtoFile.RegisterAllExtensions(registry);
+ UnittestLite.RegisterAllExtensions(registry);
copy = copy.ToBuilder().MergeDelimitedFrom(s, registry).Build();
TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
- Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
+ Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite));
}
[TestMethod]
@@ -152,7 +152,7 @@ namespace Google.ProtocolBuffers {
TestAllExtensionsLite copy,
msg = TestAllExtensionsLite.CreateBuilder()
- .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite,
+ .SetExtension(UnittestLite.OptionalStringExtensionLite,
"Should be merged.").Build();
copy = TestAllExtensionsLite.DefaultInstance;
@@ -163,11 +163,11 @@ namespace Google.ProtocolBuffers s.Position = 0;
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestLiteProtoFile.RegisterAllExtensions(registry);
+ UnittestLite.RegisterAllExtensions(registry);
copy = copy.ToBuilder().MergeFrom(s, registry).Build();
TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
- Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
+ Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite));
}
[TestMethod]
@@ -203,7 +203,7 @@ namespace Google.ProtocolBuffers {
TestAllExtensionsLite copy,
msg = TestAllExtensionsLite.CreateBuilder()
- .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite,
+ .SetExtension(UnittestLite.OptionalStringExtensionLite,
"Should be merged.").Build();
copy = TestAllExtensionsLite.DefaultInstance;
@@ -215,13 +215,13 @@ namespace Google.ProtocolBuffers Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray());
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestLiteProtoFile.RegisterAllExtensions(registry);
+ UnittestLite.RegisterAllExtensions(registry);
copy =
(TestAllExtensionsLite)
((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), registry).WeakBuild();
TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray());
- Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite));
+ Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite));
}
[TestMethod]
|