aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf.Test/IssuesTest.cs
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2015-07-30 14:06:01 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2015-07-31 07:00:25 +0100
commitf994cfe8084ee81916a546715254d93c9f2a9380 (patch)
treefd6e6f52a8433d7119825c3e92f45d5db3d3e918 /csharp/src/Google.Protobuf.Test/IssuesTest.cs
parentb193503aa74d493556af0fa08a99ba1fd97035af (diff)
Handle field names of "descriptor" and "types".
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/IssuesTest.cs')
-rw-r--r--csharp/src/Google.Protobuf.Test/IssuesTest.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf.Test/IssuesTest.cs b/csharp/src/Google.Protobuf.Test/IssuesTest.cs
index b5ad34ae..47a10c50 100644
--- a/csharp/src/Google.Protobuf.Test/IssuesTest.cs
+++ b/csharp/src/Google.Protobuf.Test/IssuesTest.cs
@@ -52,5 +52,13 @@ namespace Google.Protobuf
// TODO(jonskeet): Reflection...
// Assert.AreEqual(3, (int)message[field]);
}
+
+ [Test]
+ public void ReservedNames()
+ {
+ var message = new ReservedNames { Types_ = 10, Descriptor_ = 20 };
+ // Underscores aren't reflected in the JSON.
+ Assert.AreEqual("{ \"types\": 10, \"descriptor\": 20 }", message.ToString());
+ }
}
}