diff options
author | Jon Skeet <jonskeet@google.com> | 2015-08-03 11:08:53 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-08-03 11:30:15 +0100 |
commit | 0e0e0c97e7d5a70b3307c2fcea8793983b6e0680 (patch) | |
tree | 00f2d3938d3efd08057024143a7afea36786a008 /csharp/src/Google.Protobuf.Test/FieldCodecTest.cs | |
parent | bf1cc9217a486cf68c2705d4f307fddb73291004 (diff) | |
download | protobuf-0e0e0c97e7d5a70b3307c2fcea8793983b6e0680.tar.gz protobuf-0e0e0c97e7d5a70b3307c2fcea8793983b6e0680.tar.bz2 protobuf-0e0e0c97e7d5a70b3307c2fcea8793983b6e0680.zip |
Expose Coded*Stream constructors directly.
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/FieldCodecTest.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/FieldCodecTest.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs index c6ed2a21..6f145a44 100644 --- a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs +++ b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs @@ -120,11 +120,11 @@ namespace Google.Protobuf public void TestRoundTripRaw() { var stream = new MemoryStream(); - var codedOutput = CodedOutputStream.CreateInstance(stream); + var codedOutput = new CodedOutputStream(stream); codec.ValueWriter(codedOutput, sampleValue); codedOutput.Flush(); stream.Position = 0; - var codedInput = CodedInputStream.CreateInstance(stream); + var codedInput = new CodedInputStream(stream); Assert.AreEqual(sampleValue, codec.ValueReader(codedInput)); Assert.IsTrue(codedInput.IsAtEnd); } @@ -132,11 +132,11 @@ namespace Google.Protobuf public void TestRoundTripWithTag() { var stream = new MemoryStream(); - var codedOutput = CodedOutputStream.CreateInstance(stream); + var codedOutput = new CodedOutputStream(stream); codec.WriteTagAndValue(codedOutput, sampleValue); codedOutput.Flush(); stream.Position = 0; - var codedInput = CodedInputStream.CreateInstance(stream); + var codedInput = new CodedInputStream(stream); codedInput.AssertNextTag(codec.Tag); Assert.AreEqual(sampleValue, codec.Read(codedInput)); Assert.IsTrue(codedInput.IsAtEnd); @@ -145,7 +145,7 @@ namespace Google.Protobuf public void TestCalculateSizeWithTag() { var stream = new MemoryStream(); - var codedOutput = CodedOutputStream.CreateInstance(stream); + var codedOutput = new CodedOutputStream(stream); codec.WriteTagAndValue(codedOutput, sampleValue); codedOutput.Flush(); Assert.AreEqual(stream.Position, codec.CalculateSizeWithTag(sampleValue)); @@ -155,7 +155,7 @@ namespace Google.Protobuf { // WriteTagAndValue ignores default values var stream = new MemoryStream(); - var codedOutput = CodedOutputStream.CreateInstance(stream); + var codedOutput = new CodedOutputStream(stream); codec.WriteTagAndValue(codedOutput, codec.DefaultValue); codedOutput.Flush(); Assert.AreEqual(0, stream.Position); @@ -168,13 +168,13 @@ namespace Google.Protobuf // The plain ValueWriter/ValueReader delegates don't. if (codec.DefaultValue != null) // This part isn't appropriate for message types. { - codedOutput = CodedOutputStream.CreateInstance(stream); + codedOutput = new CodedOutputStream(stream); codec.ValueWriter(codedOutput, codec.DefaultValue); codedOutput.Flush(); Assert.AreNotEqual(0, stream.Position); Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue)); stream.Position = 0; - var codedInput = CodedInputStream.CreateInstance(stream); + var codedInput = new CodedInputStream(stream); Assert.AreEqual(codec.DefaultValue, codec.ValueReader(codedInput)); } } |