diff options
author | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:35:22 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:35:22 +0100 |
commit | 5d7adf66ceb531be50cec1963ecdf271f5fc591e (patch) | |
tree | d34f52a7dcd26a60cafc28e6125b038552a1cbf7 /csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs | |
parent | 3f9a6f211664021db368c4b4549793935315382a (diff) | |
download | protobuf-5d7adf66ceb531be50cec1963ecdf271f5fc591e.tar.gz protobuf-5d7adf66ceb531be50cec1963ecdf271f5fc591e.tar.bz2 protobuf-5d7adf66ceb531be50cec1963ecdf271f5fc591e.zip |
First unit test reading a complete message\!
Diffstat (limited to 'csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs')
-rw-r--r-- | csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs b/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs index c2b2a832..3be8041c 100644 --- a/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs +++ b/csharp/ProtocolBuffers.Test/CodedInputStreamTest.cs @@ -15,6 +15,7 @@ // limitations under the License. using System; using System.IO; +using Google.ProtocolBuffers.TestProtos; using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -183,23 +184,22 @@ namespace Google.ProtocolBuffers { Assert.AreEqual(unchecked((long)0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); } - /* TODO(jonskeet): Reinstate this when protoc is ready - public void testReadWholeMessage() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); + [Test] + public void ReadWholeMessage() { + TestAllTypes message = TestUtil.GetAllSet(); - byte[] rawBytes = message.toByteArray(); - assertEquals(rawBytes.length, message.getSerializedSize()); + byte[] rawBytes = message.ToByteArray(); + Assert.AreEqual(rawBytes.Length, message.SerializedSize); - TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); - TestUtil.assertAllFieldsSet(message2); + TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); + TestUtil.AssertAllFieldsSet(message2); // Try different block sizes. for (int blockSize = 1; blockSize < 256; blockSize *= 2) { - message2 = TestAllTypes.parseFrom( - new SmallBlockInputStream(rawBytes, blockSize)); - TestUtil.assertAllFieldsSet(message2); + message2 = TestAllTypes.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize)); + TestUtil.AssertAllFieldsSet(message2); } - }*/ + } /* TODO(jonskeet): Reinstate this when protoc is ready public void testSkipWholeMessage() throws Exception { |