diff options
author | Jon Skeet <jonskeet@google.com> | 2015-07-30 14:06:01 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-07-31 07:00:25 +0100 |
commit | f994cfe8084ee81916a546715254d93c9f2a9380 (patch) | |
tree | fd6e6f52a8433d7119825c3e92f45d5db3d3e918 /csharp/src/Google.Protobuf.Test/IssuesTest.cs | |
parent | b193503aa74d493556af0fa08a99ba1fd97035af (diff) | |
download | protobuf-f994cfe8084ee81916a546715254d93c9f2a9380.tar.gz protobuf-f994cfe8084ee81916a546715254d93c9f2a9380.tar.bz2 protobuf-f994cfe8084ee81916a546715254d93c9f2a9380.zip |
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.cs | 8 |
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());
+ }
}
}
|