-
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.
Add methods to get FsWorksheet by name + unit tests
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
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
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,27 @@ | ||
module FsWorkbook | ||
|
||
open Expecto | ||
open FsSpreadsheet | ||
|
||
|
||
let dummyWorkbook = new FsWorkbook() | ||
let dummyWorksheet = FsWorksheet("dummyWorksheet") | ||
dummyWorkbook.AddWorksheet dummyWorksheet |> ignore | ||
|
||
|
||
[<Tests>] | ||
let fsWorkbookTests = | ||
testList "FsWorkbook" [ | ||
testList "TryGetWorksheetByName" [ | ||
let testWorksheet = dummyWorkbook.TryGetWorksheetByName "dummyWorksheet" | ||
testCase "is Some" <| fun _ -> | ||
Expect.isSome testWorksheet "is None" | ||
// TO DO: add more cases | ||
] | ||
testList "GetWorksheetByName" [ | ||
testCase "does not throw exception when present" <| fun _ -> | ||
Expect.isOk (dummyWorkbook.GetWorksheetByName "dummyWorksheet" |> Result.Ok) "did throw exception" | ||
testCase "does throw exception when not present" <| fun _ -> | ||
Expect.throws (fun () -> dummyWorkbook.GetWorksheetByName "bla" |> ignore) "did not throw exception" | ||
] | ||
] |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
module FsWorkSheet | ||
|
||
open Expecto | ||
open FsSpreadsheet | ||
|
||
|