I'm writing F# code and tests in xUnit 1.9.
For normal sync stuff, I simply return unit
and all is well; but now, I'm migrating the sync innards to be async
workflows.
In other words, my simple AAA is getting explicit Async
usage pushed out into it as I refactor the system:
let [<Fact>] ``Can consume using NEventStore InMemory`` () =
let store = NesGateway.createInMemory ()
let finalDirection = playCircuit store |> Async.RunSynchronously // <----- YUCK
test <@ CounterClockWise = finalDirection @>
To remedy this, I want to make the body of the test be async
. However, to the best of my knowledge, xUnit.net only manages methods returning Task
-derived types, and hence I need a safe way of having my async
test body be wrapped suitably for xUnit.net's runner to pick it up and handle it appropriately.
What's the best way to express my above test ?
F = variation between sample means / variation within the samples. The best way to understand this ratio is to walk through a one-way ANOVA example. We'll analyze four samples of plastic to determine whether they have different mean strengths. You can download the sample data if you want to follow along.
ANOVA and F-tests assess the amount of variability between the group means in the context of the variation within groups to determine whether the mean differences are statistically significant.
As part of xUnit 2.2 Beta 3, @Brad Wilson has done the necessary to make it work natively directly. Hence one can now simply write:
let [<Fact>] ``Can consume NEventStore InMemory`` () = async {
let store = NesGateway.createInMemory ()
let! finalDirection = playCircuit store
test <@ CounterClockWise = finalDirection @> }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With