From f3df42254b3cd997acd25e82f19fa8d850729dd4 Mon Sep 17 00:00:00 2001 From: Libra_Chris <59606965+LibraChris@users.noreply.github.com> Date: Wed, 28 Feb 2024 00:22:36 +0100 Subject: [PATCH] Add Test for ARC Tokenisation --- .../FileSystemTokenization.fs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/ARCTokenization.Tests/TokenizationTests/FileSystemTokenization.fs b/tests/ARCTokenization.Tests/TokenizationTests/FileSystemTokenization.fs index 90e2630..de90e33 100644 --- a/tests/ARCTokenization.Tests/TokenizationTests/FileSystemTokenization.fs +++ b/tests/ARCTokenization.Tests/TokenizationTests/FileSystemTokenization.fs @@ -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/")) + + [] + 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)) + )