From ab4f37ef5abf8f18fd25e0d078b97637b0cf3bf9 Mon Sep 17 00:00:00 2001 From: Adam Simon Date: Tue, 9 Jan 2024 13:58:10 +0100 Subject: [PATCH] Add special character tests --- .../BasicConfigCatClientIntegrationTests.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/ConfigCat.Client.Tests/BasicConfigCatClientIntegrationTests.cs b/src/ConfigCat.Client.Tests/BasicConfigCatClientIntegrationTests.cs index 43e0bd44..9deaa654 100644 --- a/src/ConfigCat.Client.Tests/BasicConfigCatClientIntegrationTests.cs +++ b/src/ConfigCat.Client.Tests/BasicConfigCatClientIntegrationTests.cs @@ -460,4 +460,31 @@ public void Ensure_Multiple_Requests_Doesnt_Interfere_In_ValueTasks() manualPollClient.ForceRefresh(); }); } + + // https://app.configcat.com/v2/e7a75611-4256-49a5-9320-ce158755e3ba/08d5a03c-feb7-af1e-a1fa-40b3329f8bed/08dc016a-675e-4aa2-8492-6f572ad98037/244cf8b0-f604-11e8-b543-f23c917f9d8d + private const string SpecialCharactersSdkKey = "configcat-sdk-1/PKDVCLf-Hq-h-kCzMp-L7Q/u28_1qNyZ0Wz-ldYHIU7-g"; + + [TestMethod] + public async Task SpecialCharacters_Works_Cleartext() + { + using var client = ConfigCatClient.Get(SpecialCharactersSdkKey, options => + { + options.PollingMode = PollingModes.LazyLoad(); + }); + + var actual = await client.GetValueAsync("specialCharacters", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀")); + Assert.AreEqual("äöüÄÖÜçéèñışğ⢙✓😀", actual); + } + + [TestMethod] + public async Task SpecialCharacters_Works_Hashed() + { + using var client = ConfigCatClient.Get(SpecialCharactersSdkKey, options => + { + options.PollingMode = PollingModes.LazyLoad(); + }); + + var actual = await client.GetValueAsync("specialCharactersHashed", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀")); + Assert.AreEqual("äöüÄÖÜçéèñışğ⢙✓😀", actual); + } }