diff options
Diffstat (limited to 'csharp/src/Google.Protobuf.Test')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/FieldCodecTest.cs | 2 | ||||
-rw-r--r-- | csharp/src/Google.Protobuf.Test/IssuesTest.cs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs index 6f145a44..38ba227f 100644 --- a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs +++ b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs @@ -39,6 +39,7 @@ namespace Google.Protobuf { public class FieldCodecTest { +#pragma warning disable 0414 // Used by tests via reflection - do not remove! private static readonly List<ICodecTestData> Codecs = new List<ICodecTestData> { new FieldCodecTestData<bool>(FieldCodec.ForBool(100), true, "Bool"), @@ -61,6 +62,7 @@ namespace Google.Protobuf new FieldCodecTestData<ForeignMessage>( FieldCodec.ForMessage(100, ForeignMessage.Parser), new ForeignMessage { C = 10 }, "Message"), }; +#pragma warning restore 0414 [Test, TestCaseSource("Codecs")] public void RoundTripWithTag(ICodecTestData codec) diff --git a/csharp/src/Google.Protobuf.Test/IssuesTest.cs b/csharp/src/Google.Protobuf.Test/IssuesTest.cs index 47a10c50..a0350035 100644 --- a/csharp/src/Google.Protobuf.Test/IssuesTest.cs +++ b/csharp/src/Google.Protobuf.Test/IssuesTest.cs @@ -49,8 +49,7 @@ namespace Google.Protobuf ItemField message = new ItemField { Item = 3 };
FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item");
Assert.NotNull(field);
- // TODO(jonskeet): Reflection...
- // Assert.AreEqual(3, (int)message[field]);
+ Assert.AreEqual(3, (int)field.Accessor.GetValue(message));
}
[Test]
|