-
-
Notifications
You must be signed in to change notification settings - Fork 363
test(Localizer): update GetJsonStringByTypeName_UseKeyWhenValueIsNull test #7088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
| // See the LICENSE file in the project root for more information. | ||
| // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||
|
|
@@ -44,7 +44,7 @@ public class JsonLocalizationOptions : LocalizationOptions | |
| public bool IgnoreLocalizerMissing { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 如果 Value 值为 null 时使用 Key 代替 默认 false 触发异常 | ||
| /// 获得/设置 如果 Value 值为 null 时使用 Key 代替 默认 false | ||
| /// </summary> | ||
| public bool UseKeyWhenValueIsNull { get; set; } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||
| // Licensed to the .NET Foundation under one or more agreements. | ||||||||||||||
| // Licensed to the .NET Foundation under one or more agreements. | ||||||||||||||
| // The .NET Foundation licenses this file to you under the Apache 2.0 License | ||||||||||||||
| // See the LICENSE file in the project root for more information. | ||||||||||||||
| // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||||||||||||||
|
|
@@ -393,14 +393,19 @@ public void GetJsonStringByTypeName_UseKeyWhenValueIsNull() | |||||||||||||
|
|
||||||||||||||
| var test1 = items.FirstOrDefault(i => i.Name == "Test-Null"); | ||||||||||||||
| Assert.NotNull(test1); | ||||||||||||||
|
|
||||||||||||||
| #if NET9_0 | ||||||||||||||
| Assert.Equal("", test1.Value); | ||||||||||||||
| #elif NET10_0_OR_GREATER | ||||||||||||||
| Assert.Equal("Test-Null", test1.Value); | ||||||||||||||
| #endif | ||||||||||||||
|
Comment on lines
+397
to
+401
|
||||||||||||||
| #if NET9_0 | |
| Assert.Equal("", test1.Value); | |
| #elif NET10_0_OR_GREATER | |
| Assert.Equal("Test-Null", test1.Value); | |
| #endif | |
| Assert.Equal("", test1.Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional compilation directive uses
NET9_0(exact version match) which is inconsistent with the pattern used elsewhere in the codebase. Other files useNET9_0_OR_GREATER(e.g., inCacheManager.cs,DefaultDispatchService.cs,ICacheManager.cs).Consider using
NET9_0_OR_GREATERinstead for consistency and to ensure the code works correctly for future .NET 9.x patch versions.