diff options
author | Jie Luo <anandolee@gmail.com> | 2015-04-28 16:26:19 -0700 |
---|---|---|
committer | Jie Luo <anandolee@gmail.com> | 2015-04-28 16:26:19 -0700 |
commit | 8bae6c09bc8c8be808f0acc9b2ad4c9811493060 (patch) | |
tree | 9819ef25dbe807e4e7f0d6c7dbff7f553b1a8723 /csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs | |
parent | 8a3ec53e862cffd310caf434c2c0898782c952f7 (diff) | |
parent | 32ead755d1f97e414f4a50edb7d9f1ebd9cab562 (diff) | |
download | protobuf-8bae6c09bc8c8be808f0acc9b2ad4c9811493060.tar.gz protobuf-8bae6c09bc8c8be808f0acc9b2ad4c9811493060.tar.bz2 protobuf-8bae6c09bc8c8be808f0acc9b2ad4c9811493060.zip |
Merge pull request #1 from google/csharp
Csharp update
Diffstat (limited to 'csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs')
-rw-r--r-- | csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs index 37739d2f..0640a445 100644 --- a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs @@ -72,17 +72,19 @@ namespace Google.ProtocolBuffers .AddAddresses(
TestInteropPerson.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland").
SetState("NA").SetZip(12345).Build())
- .SetExtension(UnitTestExtrasFullProtoFile.EmployeeId,
+ .SetExtension(UnittestExtrasFull.EmployeeId,
TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build())
.Build();
Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestExtrasLiteProtoFile.RegisterAllExtensions(registry);
+ UnittestExtrasLite.RegisterAllExtensions(registry);
+ byte[] fullBytes = person.ToByteArray();
- TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray(), registry);
+ TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(fullBytes, registry);
+ byte[] liteBytes = copy.ToByteArray();
- TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(fullBytes, liteBytes);
}
[TestMethod]
@@ -112,13 +114,13 @@ namespace Google.ProtocolBuffers .AddAddresses(
TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland")
.SetState("NA").SetZip(12345).Build())
- .SetExtension(UnitTestExtrasLiteProtoFile.EmployeeIdLite,
+ .SetExtension(UnittestExtrasLite.EmployeeIdLite,
TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build())
.Build();
Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestExtrasFullProtoFile.RegisterAllExtensions(registry);
+ UnittestExtrasFull.RegisterAllExtensions(registry);
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
@@ -151,13 +153,13 @@ namespace Google.ProtocolBuffers .AddAddresses(
TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland")
.SetState("NA").SetZip(12345).Build())
- .SetExtension(UnitTestExtrasLiteProtoFile.EmployeeIdLite,
+ .SetExtension(UnittestExtrasLite.EmployeeIdLite,
TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build())
.Build();
Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
- UnitTestExtrasFullProtoFile.RegisterAllExtensions(registry);
+ UnittestExtrasFull.RegisterAllExtensions(registry);
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
|