We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33b8194 commit 7f08903Copy full SHA for 7f08903
1 file changed
GameFrameX.Foundation.Tests/Json/JsonHelperTests.cs
@@ -321,6 +321,23 @@ public void EnumAsString_ShouldWork()
321
Assert.Equal(testObject.Name, deserializedObject.Name);
322
Assert.Equal(testObject.Status, deserializedObject.Status);
323
}
324
+
325
+ /// <summary>
326
+ /// 测试中文字符序列化时不应被转义
327
+ /// </summary>
328
+ [Fact]
329
+ public void ChineseCharacterSerialization_ShouldNotBeEscaped()
330
+ {
331
+ // 准备测试数据
332
+ var testObject = new { Name = "测试中文" };
333
334
+ // 序列化
335
+ string json = JsonHelper.Serialize(testObject);
336
337
+ // 验证结果不包含Unicode转义序列
338
+ Assert.Contains("测试中文", json);
339
+ Assert.DoesNotContain("\\u", json);
340
+ }
341
342
343
/// <summary>
0 commit comments