diff options
author | Jon Skeet <jonskeet@google.com> | 2016-11-03 09:24:29 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2016-11-03 18:05:59 +0000 |
commit | 50a37e0135c8dea723244b97b2fb76e56a5aece0 (patch) | |
tree | c9d0620d22ed0673be5cb272112d12f19a8dac66 /csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs | |
parent | 93a4fa23d0e6d5c04d4c03aa0002fb483d7a77ee (diff) | |
download | protobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.tar.gz protobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.tar.bz2 protobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.zip |
Change JSON field name formatting
This affects cases with leading capital letters.
This breaks compatibility with previous C# releases, but
fixes compatibility with other implementations.
See #2278 for details.
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index 261ac6a7..302f8143 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -229,16 +229,16 @@ namespace Google.Protobuf [Test] [TestCase("foo_bar", "fooBar")] [TestCase("bananaBanana", "bananaBanana")] - [TestCase("BANANABanana", "bananaBanana")] + [TestCase("BANANABanana", "BANANABanana")] [TestCase("simple", "simple")] - [TestCase("ACTION_AND_ADVENTURE", "actionAndAdventure")] + [TestCase("ACTION_AND_ADVENTURE", "ACTIONANDADVENTURE")] [TestCase("action_and_adventure", "actionAndAdventure")] [TestCase("kFoo", "kFoo")] - [TestCase("HTTPServer", "httpServer")] - [TestCase("CLIENT", "client")] - public void ToCamelCase(string original, string expected) + [TestCase("HTTPServer", "HTTPServer")] + [TestCase("CLIENT", "CLIENT")] + public void ToJsonName(string original, string expected) { - Assert.AreEqual(expected, JsonFormatter.ToCamelCase(original)); + Assert.AreEqual(expected, JsonFormatter.ToJsonName(original)); } [Test] |