From a702bbf06b3f7e77fc6c95627bbbc88fe62d6338 Mon Sep 17 00:00:00 2001 From: Young Date: Thu, 5 Dec 2024 10:48:54 +0800 Subject: [PATCH] update test methods --- src/Infrastructure.Tests/GenericTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Infrastructure.Tests/GenericTests.cs b/src/Infrastructure.Tests/GenericTests.cs index 909d709..bfb2afb 100644 --- a/src/Infrastructure.Tests/GenericTests.cs +++ b/src/Infrastructure.Tests/GenericTests.cs @@ -1,4 +1,5 @@ using System.Security.Cryptography; +using System.Web; using Newtonsoft.Json; namespace Infrastructure.Tests; @@ -36,4 +37,14 @@ public class GenericTests Assert.NotEmpty(hashString); Assert.NotNull(hashString); } + + [Fact] + public void EncodeTest() + { + var raw = + "XFwxMC4zMC4yLjIwMFxqenl0MDFc57K+6KOFXOaWveW3peWbvuS4gOe7hFzpobnnm67mlofku7Zc5Li05pe25paH5Lu2XOijhemFjeW8j+WwgeijhVwwM1/lt6XkvZznqbrpl7Rc6KOF6YWN5byP5bCB6KOF5p6E5Lu25bqTXOW5s+mdoi5kd2c="; + var encoded = HttpUtility.UrlEncode(raw); + var decoded = HttpUtility.UrlDecode(encoded); + Assert.Equal(raw, decoded); + } } \ No newline at end of file