aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-07-03 11:41:37 +0100
committerJon Skeet <jonskeet@google.com>2015-07-09 08:26:07 +0100
commit14f2222a50a18ff0d8772095587b9cdad455a7bb (patch)
tree1422e99fad875a04921a0b8c881f48c63937f84c /csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
parentaf259b77bf04fcfb68609776cb27f04d289a2c39 (diff)
downloadprotobuf-14f2222a50a18ff0d8772095587b9cdad455a7bb.tar.gz
protobuf-14f2222a50a18ff0d8772095587b9cdad455a7bb.tar.bz2
protobuf-14f2222a50a18ff0d8772095587b9cdad455a7bb.zip
Lots more tests for FieldCodec, MapField, RepeatedField
... and some implementation changes to go with them.
Diffstat (limited to 'csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs')
-rw-r--r--csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs b/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
index a14040d1..c6ed2a21 100644
--- a/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
+++ b/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
@@ -86,12 +86,22 @@ namespace Google.Protobuf
codec.TestDefaultValue();
}
+ [Test, TestCaseSource("Codecs")]
+ public void FixedSize(ICodecTestData codec)
+ {
+ codec.TestFixedSize();
+ }
+
+ // This is ugly, but it means we can have a non-generic interface.
+ // It feels like NUnit should support this better, but I don't know
+ // of any better ways right now.
public interface ICodecTestData
{
void TestRoundTripRaw();
void TestRoundTripWithTag();
void TestCalculateSizeWithTag();
void TestDefaultValue();
+ void TestFixedSize();
}
public class FieldCodecTestData<T> : ICodecTestData
@@ -169,6 +179,11 @@ namespace Google.Protobuf
}
}
+ public void TestFixedSize()
+ {
+ Assert.AreEqual(name.Contains("Fixed"), codec.FixedSize != 0);
+ }
+
public override string ToString()
{
return name;