From 44a4f83888b4cf8ab0b26b3036feda7d41864c9b Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Tue, 24 Mar 2020 15:29:57 +1000 Subject: [PATCH] Fix AED tests Had to add vstest adapter. Also fixed a few warnings. Work done for #196 --- build/azure-pipelines-build.yml | 1 - tests/AED.Test/AED.Test.fsproj | 1 + tests/AED.Test/AcousticEventDetectionTest.fs | 20 ++++++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/build/azure-pipelines-build.yml b/build/azure-pipelines-build.yml index 88b2d4399..ecf13dff0 100644 --- a/build/azure-pipelines-build.yml +++ b/build/azure-pipelines-build.yml @@ -106,7 +106,6 @@ jobs: command: test publishTestResults: true testRunTitle: "Tests for $(rid) $(configuration)" - projects: tests/Acoustics.Test/Acoustics.Test.csproj arguments: > --runtime $(rid) --configuration $(configuration) diff --git a/tests/AED.Test/AED.Test.fsproj b/tests/AED.Test/AED.Test.fsproj index 7e3847c48..37aaf21ab 100644 --- a/tests/AED.Test/AED.Test.fsproj +++ b/tests/AED.Test/AED.Test.fsproj @@ -34,6 +34,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/tests/AED.Test/AcousticEventDetectionTest.fs b/tests/AED.Test/AcousticEventDetectionTest.fs index 62f6dc059..d5da34dab 100644 --- a/tests/AED.Test/AcousticEventDetectionTest.fs +++ b/tests/AED.Test/AcousticEventDetectionTest.fs @@ -258,7 +258,10 @@ module AcousticEventDetectionTestsForSeperateLargeEvents = [] let ``seperate large events - hits returned for event 3 when ExtrapolateBridgeEvents is diabled`` () = - let sleParams = match sleDefaults with Horizontal p -> {p with ExtrapolateBridgeEvents = false} |> Horizontal + let sleParams = + match sleDefaults with + | Horizontal p -> {p with ExtrapolateBridgeEvents = false} |> Horizontal + | _ -> invalidOp "invalid match case" let result = testMatrix |> getAcousticEvents |> separateLargeEvents sleParams|> Seq.item 2 let absoluteHits = Set.map (fun (y, x) -> (y + 4, x + 43)) expectedEvent3Alternate @@ -403,7 +406,10 @@ module AcousticEventDetectionTestsForVerticalSeperateLargeEvents = [] let ``seperate large events - hits returned for event 3 when ExtrapolateBridgeEvents is diabled`` () = - let sleParams = match sleParams with Vertical p -> {p with ExtrapolateBridgeEvents = false} |> Vertical + let sleParams = + match sleParams with + | Vertical p -> {p with ExtrapolateBridgeEvents = false} |> Vertical + | _ -> invalidOp "invalid match case" let result = testMatrix |> getAcousticEvents |> separateLargeEvents sleParams |> Seq.item 2 let absoluteHits = Set.map (fun (y, x) -> (y + 9, x + 43)) expectedEvent3Alternate @@ -515,13 +521,11 @@ module AcousticEventDetectionTestsForDebugSeperateLargeEvents = [] let ``seperate large events - hits returned for event 3 when ExtrapolateBridgeEvents is diabled`` () = - let sleParams = match sleParams with Horizontal p -> {p with ExtrapolateBridgeEvents = false} |> Horizontal + let sleParams = + match sleParams with + | Horizontal p -> {p with ExtrapolateBridgeEvents = false} |> Horizontal + | _ -> invalidOp "invalid match case" let result = testMatrix |> getAcousticEvents |> separateLargeEvents sleParams |> Seq.item 1 let absoluteHits = Set.map (fun (y,x) -> (y + 1, x + 64)) expectedEvent2Alternate Assert.Equal>(absoluteHits, result.Elements) Assert.Equal(expectedAlternateBounds, result.Bounds) - - - - -