diff --git a/tests/FsSpreadsheet.ExcelIO.Tests/FsSpreadsheet.ExcelIO.Tests.fsproj b/tests/FsSpreadsheet.ExcelIO.Tests/FsSpreadsheet.ExcelIO.Tests.fsproj index b6da019a..3007ac14 100644 --- a/tests/FsSpreadsheet.ExcelIO.Tests/FsSpreadsheet.ExcelIO.Tests.fsproj +++ b/tests/FsSpreadsheet.ExcelIO.Tests/FsSpreadsheet.ExcelIO.Tests.fsproj @@ -9,6 +9,7 @@ + diff --git a/tests/FsSpreadsheet.ExcelIO.Tests/Sheet.fs b/tests/FsSpreadsheet.ExcelIO.Tests/Sheet.fs new file mode 100644 index 00000000..4263f587 --- /dev/null +++ b/tests/FsSpreadsheet.ExcelIO.Tests/Sheet.fs @@ -0,0 +1,29 @@ +module Sheet + +open Expecto +open FsSpreadsheet.ExcelIO +open DocumentFormat.OpenXml + +let testFilePath = System.IO.Path.Combine(__SOURCE_DIRECTORY__, "data", "testUnit.xlsx") +// *fox = from OpenXml, to distinguish between objects from FsSpreadsheet.ExcelIO +let ssdFox = Packaging.SpreadsheetDocument.Open(testFilePath, false) +let wbpFox = ssdFox.WorkbookPart +let wbFox = wbpFox.Workbook +let shtsFox = wbFox.Sheets +let shtssFox = shtsFox.Descendants() |> Array.ofSeq // array is needed since seqs cannot be compared + + +[] +let sheetsTests = + testList "Sheets" [ + testList "get" [ + testCase "is equal to shtsFox" <| fun _ -> + let shts = Sheet.Sheets.get wbFox + Expect.equal shts shtsFox "Differs" + ] + testList "getSheets" [ + testCase "is equal to shtssFox" <| fun _ -> + let shtss = Sheet.Sheets.getSheets shtsFox |> Array.ofSeq // array is needed since seqs cannot be compared + Expect.equal shtss shtssFox "Differs" + ] + ] \ No newline at end of file