aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs
diff options
context:
space:
mode:
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;