-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for `Sheets.get` and `Sheets.getSheets`.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Spreadsheet.Sheet>() |> Array.ofSeq // array is needed since seqs cannot be compared | ||
|
||
|
||
[<Tests>] | ||
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" | ||
] | ||
] |