From f2fe50bfc516cdab99f51fa2ca90ba0db1ef6637 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 13 Jan 2016 14:05:06 +0000 Subject: JSON conformance test fixes - Spot an Any without a type URL - In the conformance test runner, catch exceptions due to generally-invalid JSON --- csharp/src/Google.Protobuf.Test/JsonParserTest.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'csharp/src/Google.Protobuf.Test') 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 @@ -762,6 +762,13 @@ namespace Google.Protobuf Assert.Throws(() => Any.Parser.ParseJson(json)); } + [Test] + public void Any_NoTypeUrl() + { + string json = "{ \"foo\": \"bar\" }"; + Assert.Throws(() => Any.Parser.ParseJson(json)); + } + [Test] public void Any_WellKnownType() { -- cgit v1.2.3