Skip to content

Commit

Permalink
Fix AED tests
Browse files Browse the repository at this point in the history
Had to add vstest adapter.

Also fixed a few warnings.

Work done for #196
  • Loading branch information
atruskie committed Mar 24, 2020
1 parent 628d95c commit 2b65564
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions build/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,14 @@ jobs:
command: test
publishTestResults: true
testRunTitle: "Tests for $(rid) $(configuration)"
projects: tests/Acoustics.Test/Acoustics.Test.csproj
arguments: >
--runtime $(rid)
--configuration $(configuration)
--settings tests/Acoustics.Test/.runsettings
--no-build
--logger trx
--collect:"XPlat Code Coverage"
-- RunConfiguration.DisableAppDomain=true
--RunConfiguration.DisableAppDomain=true
displayName: Run tests

- task: DotNetCoreCLI@2
Expand Down
1 change: 1 addition & 0 deletions tests/AED.Test/AED.Test.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Acoustics.Shared.FSharp\Acoustics.Shared.FSharp.fsproj" />
Expand Down
20 changes: 12 additions & 8 deletions tests/AED.Test/AcousticEventDetectionTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ module AcousticEventDetectionTestsForSeperateLargeEvents =

[<Fact>]
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
Expand Down Expand Up @@ -403,7 +406,10 @@ module AcousticEventDetectionTestsForVerticalSeperateLargeEvents =

[<Fact>]
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
Expand Down Expand Up @@ -515,13 +521,11 @@ module AcousticEventDetectionTestsForDebugSeperateLargeEvents =

[<Fact>]
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<Set<_>>(absoluteHits, result.Elements)
Assert.Equal(expectedAlternateBounds, result.Bounds)





0 comments on commit 2b65564

Please sign in to comment.