Skip to content

Commit

Permalink
Add Test for ARC Tokenisation
Browse files Browse the repository at this point in the history
  • Loading branch information
LibraChris committed Feb 27, 2024
1 parent d09ff31 commit f3df422
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,35 @@ module FileSystem =
List.zip expected actual,
fun (e, a) -> Assert.True(e.Equals(a))
)


let parsedFilePathsArc = FS.tokenizeARCFileSystem (Path.Combine(System.Environment.CurrentDirectory, "Fixtures/arcStructure/"))

[<Fact>]
let ``Test ARC Tokenisation``() =
let actual = parsedFilePathsArc |> List.ofSeq |> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)
let expected =
[
CvParam(StructuralOntology.AFSO.``Assays Directory`` , "assays")
CvParam(StructuralOntology.AFSO.``Assay Directory`` , "assays/measurement1")
CvParam(StructuralOntology.AFSO.``Assay File`` , "assays/measurement1/isa.assay.xlsx")
CvParam(StructuralOntology.AFSO.``Dataset File``, "assays/measurement1/isa.dataset.xlsx")
CvParam(StructuralOntology.AFSO.``Investigation File``, "isa.investigation.xlsx")
CvParam(StructuralOntology.AFSO.``Runs Directory`` , "runs")
CvParam(StructuralOntology.AFSO.``YML File`` , "runs/FSharpArcCapsule.yml")
CvParam(StructuralOntology.AFSO.``Studies Directory`` , "studies")
CvParam(StructuralOntology.AFSO.``Study Directory`` , "studies/experiment1_material")
CvParam(StructuralOntology.AFSO.``Study File`` , "studies/experiment1_material/isa.study.xlsx")
CvParam(StructuralOntology.AFSO.``Directory Path``, "studies/experiment1_material/resources")
CvParam(StructuralOntology.AFSO.``File Path``, "studies/experiment1_material/resources/.gitkeep")
CvParam(StructuralOntology.AFSO.``Workflows Directory`` ,"workflows")
CvParam(StructuralOntology.AFSO.``Workflow Directory``, "workflows/FixedScript")
CvParam(StructuralOntology.AFSO.``File Path``, "workflows/FixedScript/script.fsx")
]
|> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

Assert.All(
List.zip actual expected,
fun (a,e) ->
Assert.True(a.Equals(e))
)

0 comments on commit f3df422

Please sign in to comment.