aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf.Test
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-01-13 14:05:06 +0000
committerJon Skeet <jonskeet@google.com>2016-01-13 14:05:06 +0000
commitf2fe50bfc516cdab99f51fa2ca90ba0db1ef6637 (patch)
treee127cc82f34cdd3b8a65c39249d5a49b608f3131 /csharp/src/Google.Protobuf.Test
parent73c003c309235485c0e53f2075242567c88a72bc (diff)
downloadprotobuf-f2fe50bfc516cdab99f51fa2ca90ba0db1ef6637.tar.gz
protobuf-f2fe50bfc516cdab99f51fa2ca90ba0db1ef6637.tar.bz2
protobuf-f2fe50bfc516cdab99f51fa2ca90ba0db1ef6637.zip
JSON conformance test fixes
- Spot an Any without a type URL - In the conformance test runner, catch exceptions due to generally-invalid JSON
Diffstat (limited to 'csharp/src/Google.Protobuf.Test')
-rw-r--r--csharp/src/Google.Protobuf.Test/JsonParserTest.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs
index 303baacc..60c4d815 100644
--- a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs
+++ b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs
@@ -763,6 +763,13 @@ namespace Google.Protobuf
}
[Test]
+ public void Any_NoTypeUrl()
+ {
+ string json = "{ \"foo\": \"bar\" }";
+ Assert.Throws<InvalidProtocolBufferException>(() => Any.Parser.ParseJson(json));
+ }
+
+ [Test]
public void Any_WellKnownType()
{
var registry = TypeRegistry.FromMessages(Timestamp.Descriptor);