-
-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Description
I can't get TUnit to run F# async tests at all. To reproduce: just take any async example from the docs, or template projects, and try to make them fail, and observe that they do not (they indicate as passing):
member this.ThisTestShouldFail() = async {
let result = 0 - 1
do! check (Assert.That(result).IsPositive())
}However if you change it to use Task instead, it indeed fails as expected:
let checkT (assertion: Assertion<'T>) = assertion.AssertAsync() :> Task
member this.ThisTestShouldFail() = task {
let result = 0 - 1
do! checkT (Assert.That(result).IsPositive())
}Or explicitly use Async.RunSynchronously:
member this.ThisTestShouldFail() = Async.RunSynchronously <| async {
let result = 0 - 1
do! check (Assert.That(result).IsPositive())
}I'm using .NET 10, TUnit 1.3.25, and TUnit.Assertions.FSharp 1.3.25.
Metadata
Metadata
Assignees
Labels
No labels