aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
diff options
context:
space:
mode:
authorGravatar Jie Luo <anandolee@gmail.com>2015-04-28 16:26:19 -0700
committerGravatar Jie Luo <anandolee@gmail.com>2015-04-28 16:26:19 -0700
commit8bae6c09bc8c8be808f0acc9b2ad4c9811493060 (patch)
tree9819ef25dbe807e4e7f0d6c7dbff7f553b1a8723 /csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
parent8a3ec53e862cffd310caf434c2c0898782c952f7 (diff)
parent32ead755d1f97e414f4a50edb7d9f1ebd9cab562 (diff)
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.cs18
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);