diff --git a/samples/xlsx/TestIssue208.xlsx b/samples/xlsx/TestIssue208.xlsx deleted file mode 100644 index 43c13e5..0000000 Binary files a/samples/xlsx/TestIssue208.xlsx and /dev/null differ diff --git a/tests/MiniExcelTests/MiniExcelIssueTests.cs b/tests/MiniExcelTests/MiniExcelIssueTests.cs index 64abea7..7ec295e 100644 --- a/tests/MiniExcelTests/MiniExcelIssueTests.cs +++ b/tests/MiniExcelTests/MiniExcelIssueTests.cs @@ -38,8 +38,6 @@ namespace MiniExcelLibs.Tests Assert.Equal("test1", rows[0].V); Assert.Equal("test2", rows[1].V); - - Console.WriteLine(rows); } } @@ -65,6 +63,14 @@ Leave"; Assert.Equal(Issue89VO.WorkState.OnDuty, rows[0].State); Assert.Equal(Issue89VO.WorkState.Fired, rows[1].State); Assert.Equal(Issue89VO.WorkState.Leave, rows[2].State); + + var outputPath = Helpers.GetTempXlsxPath(); + MiniExcel.SaveAs(outputPath, rows); + var rows2 = MiniExcel.Query(outputPath).ToList(); + + Assert.Equal(Issue89VO.WorkState.OnDuty, rows2[0].State); + Assert.Equal(Issue89VO.WorkState.Fired, rows2[1].State); + Assert.Equal(Issue89VO.WorkState.Leave, rows2[2].State); } //xlsx @@ -75,8 +81,15 @@ Leave"; Assert.Equal(Issue89VO.WorkState.OnDuty, rows[0].State); Assert.Equal(Issue89VO.WorkState.Fired, rows[1].State); Assert.Equal(Issue89VO.WorkState.Leave, rows[2].State); - } + var outputPath = Helpers.GetTempXlsxPath(); + MiniExcel.SaveAs(outputPath, rows); + var rows2 = MiniExcel.Query(outputPath).ToList(); + + Assert.Equal(Issue89VO.WorkState.OnDuty, rows2[0].State); + Assert.Equal(Issue89VO.WorkState.Fired, rows2[1].State); + Assert.Equal(Issue89VO.WorkState.Leave, rows2[2].State); + } } public class Issue89VO diff --git a/tests/MiniExcelTests/Utils/Helpers.cs b/tests/MiniExcelTests/Utils/Helpers.cs index 8a8cd5e..de41375 100644 --- a/tests/MiniExcelTests/Utils/Helpers.cs +++ b/tests/MiniExcelTests/Utils/Helpers.cs @@ -100,6 +100,8 @@ namespace MiniExcelLibs.Tests.Utils return refV; } + + public static string GetTempXlsxPath() => Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.xlsx"); } }