Skip to content

Commit 051bc08

Browse files
committed
fix: Issue225 测试兼容 Linux 错误消息语言
Linux 下错误消息为英文(There is no template drop-down option), Windows 下为中文(不存在模板下拉选项中),断言同时匹配两种语言。
1 parent b37589a commit 051bc08

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Magicodes.ExporterAndImporter.Tests/ExcelImporter_Tests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,10 @@ public async Task Issue225_Test()
10501050
if (import.RowErrors.Count > 0) _testOutputHelper.WriteLine(JsonConvert.SerializeObject(import.RowErrors));
10511051

10521052
import.RowErrors.Count.ShouldBe(2);
1053-
import.RowErrors[0].FieldErrors.Any(p => p.Value.Contains("不存在模板下拉选项中")).ShouldBeTrue();
1054-
// RowErrors[1] 的错误消息可能不同,只验证存在错误
1053+
// Linux 下错误消息为英文,Windows 下为中文
1054+
import.RowErrors[0].FieldErrors.Any(p =>
1055+
p.Value.Contains("不存在模板下拉选项中") ||
1056+
p.Value.Contains("There is no template drop-down option")).ShouldBeTrue();
10551057
import.RowErrors[1].FieldErrors.Count.ShouldBeGreaterThan(0);
10561058

10571059
import.HasError.ShouldBeTrue();

0 commit comments

Comments
 (0)