-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete some unit tests and add some integration tests
Also some updates for test project, dependency- and structure-wise.
- Loading branch information
Showing
6 changed files
with
152 additions
and
89 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
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
tests/ArcGraphModel.IO.Tests/IntegrationTests/ParseInvestigationTests.fs
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,38 @@ | ||
module ParseInvestigationTests | ||
|
||
open FsSpreadsheet | ||
open FsSpreadsheet.ExcelIO | ||
open ArcGraphModel | ||
open ArcGraphModel.IO | ||
open Expecto | ||
|
||
open TestUtils | ||
|
||
|
||
let inves = FsWorkbook.fromXlsxFile "Fixtures/isa.investigation.xlsx" | ||
let invesWs = FsWorkbook.getWorksheets inves |> Seq.head | ||
let invesWsParsed = Worksheet.parseRowsFlat invesWs | ||
|
||
//let cvp1 = CvParam("", "ONTOLOGY SOURCE REFERENCE", "", ParamValue.Value "", []) | ||
let up1 = UserParam("ONTOLOGY SOURCE REFERENCE", ParamValue.Value "", []) | ||
|
||
[<Tests>] | ||
let ``Investigation File is parsed correctly`` = | ||
testList "Investigation from file" [ | ||
//testList "CvParam" [ | ||
// testCase "First Param is CvParam" (fun _ -> | ||
// Expect.isSome (invesWsParsed.Head |> CvParam.tryCvParam) "Is no CvParam" | ||
// ) | ||
// testCase "First CvParam name" (fun _ -> | ||
// CvParam.termNamesEqual (invesWsParsed.Head :?> CvParam) cvp1 | ||
// ) | ||
//] | ||
testList "UserParam" [ | ||
testCase "First Param is UserParam" (fun _ -> | ||
Expect.isSome (invesWsParsed.Head |> UserParam.tryUserParam) "Is no UserParam" | ||
) | ||
testCase "First UserParam name" (fun _ -> | ||
UserParam.termNamesEqual (invesWsParsed.Head :?> UserParam) up1 | ||
) | ||
] | ||
] |
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 |
---|---|---|
@@ -1,22 +1,8 @@ | ||
module Tests | ||
|
||
#if FABLE_COMPILER | ||
open Fable.Mocha | ||
#else | ||
open Expecto | ||
|
||
[<Tests>] | ||
#endif | ||
let all = | ||
testList "All" | ||
[ | ||
TokenAggregationTests.main | ||
KeyParserTests.main | ||
] | ||
|
||
let [<EntryPoint>] main argv = | ||
#if FABLE_COMPILER | ||
Mocha.runTests all | ||
#else | ||
Tests.runTestsWithCLIArgs [] argv all | ||
#endif | ||
[<EntryPoint>] | ||
let main argv = | ||
Tests.runTestsInAssemblyWithCLIArgs [] argv |
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,31 @@ | ||
module TestUtils | ||
|
||
open Expecto | ||
|
||
|
||
module CvParam = | ||
|
||
open ArcGraphModel | ||
|
||
let termNamesEqual (cvpActual : CvParam) (cvpExpectec : CvParam) = | ||
Expect.equal (CvBase.getCvName cvpActual) (CvBase.getCvName cvpExpectec) "CvParam names are not equal" | ||
|
||
//let attributesEqual (cvp1 : CvParam) (cvp2 : CvParam) = | ||
// (cvp1.Keys, cvp1.Values |> Seq.map ) | ||
// ||> Seq.zip | ||
// |> Seq.toList | ||
// |> List.sortBy fst | ||
|
||
|
||
module UserParam = | ||
|
||
open ArcGraphModel | ||
|
||
let termNamesEqual (upActual : UserParam) (upExpectec : UserParam) = | ||
Expect.equal (CvBase.getCvName upActual) (CvBase.getCvName upExpectec) "UserParam names are not equal" | ||
|
||
//let attributesEqual (cvp1 : CvParam) (cvp2 : CvParam) = | ||
// (cvp1.Keys, cvp1.Values |> Seq.map ) | ||
// ||> Seq.zip | ||
// |> Seq.toList | ||
// |> List.sortBy fst |