-
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.
Add first simple integration test for annotation table parsing
- Loading branch information
Showing
8 changed files
with
147 additions
and
19 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
Binary file added
BIN
+10.9 KB
tests/ArcGraphModel.Tests/Fixtures/correct/assay_with_only_source_and_sample_column.xlsx
Binary file not shown.
Binary file added
BIN
+11.3 KB
tests/ArcGraphModel.Tests/Fixtures/correct/assay_with_single_characteristics.xlsx
Binary file not shown.
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,75 @@ | ||
module IntegrationTests.Assay | ||
|
||
open ControlledVocabulary | ||
open FsSpreadsheet | ||
open FsSpreadsheet.ExcelIO | ||
open ArcGraphModel | ||
open Xunit | ||
|
||
open TestUtils | ||
open TestObjects | ||
|
||
module Correct = | ||
|
||
module ``Assay with only source and sample column`` = | ||
|
||
let assay = Assays.Correct.``assay with only source and sample column`` | ||
|
||
[<Fact>] | ||
let ``AnnotationTable count`` () = | ||
Assert.Equal(assay.Length, 1) | ||
|
||
let table = assay.[0] |> snd | ||
|
||
[<Fact>] | ||
let ``TokenizedAnnotationTable IOColumn count`` () = | ||
TokenizedAnnotationTable.hasIOColumnAmount 2 table | ||
|
||
[<Fact>] | ||
let ``TokenizedAnnotationTable TermRelatedBuildingBlocksAmount`` () = | ||
TokenizedAnnotationTable.hasTermRelatedBuildingBlockAmount 0 table | ||
|
||
let expectedIOColumns = | ||
[ | ||
[ | ||
CvParam( | ||
id = "(n/a)", | ||
name = "Source Name", | ||
ref = "(n/a)", | ||
pv = (ParamValue.Value "Source A"), | ||
attributes = [] | ||
) | ||
] | ||
[ | ||
CvParam( | ||
id = "(n/a)", | ||
name = "Sample Name", | ||
ref = "(n/a)", | ||
pv = (ParamValue.Value "Sample A"), | ||
attributes = [] | ||
) | ||
] | ||
] | ||
|
||
let expectedTermRelatedBuildingBlocks: CvParam list list = [] | ||
|
||
[<Fact>] | ||
let ``TokenizedAnnotationTable IOColumns`` () = | ||
(expectedIOColumns, table.IOColumns) | ||
||> List.iter2 (fun expectedGroup actualGroup -> | ||
(expectedGroup, actualGroup) | ||
||> List.iter2 (fun expectedParam actualParam -> | ||
CvParam.structuralEquality expectedParam actualParam | ||
) | ||
) | ||
|
||
[<Fact>] | ||
let ``TokenizedAnnotationTable TermRelatedBuildingBlocks`` () = | ||
(expectedTermRelatedBuildingBlocks, table.TermRelatedBuildingBlocks) | ||
||> List.iter2 (fun expectedGroup actualGroup -> | ||
(expectedGroup, actualGroup) | ||
||> List.iter2 (fun expectedParam actualParam -> | ||
CvParam.structuralEquality expectedParam actualParam | ||
) | ||
) | ||
|
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,13 @@ | ||
module TestObjects | ||
|
||
open ArcGraphModel | ||
|
||
module Assays = | ||
|
||
module Correct = | ||
|
||
let ``assay with only source and sample column`` = | ||
Assay.parseAnnotationTablesFromFile "Fixtures/correct/assay_with_only_source_and_sample_column.xlsx" | ||
|
||
let ``assay with characteristics`` = | ||
Assay.parseAnnotationTablesFromFile "Fixtures/correct/assay_with_single_characteristics.xlsx" |
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