Suppose I have a test like this:
module MyTests
open Xunit
[<Fact>
let ``this test always fails`` =
Assert.True(false)
Then I can build and run my tests successfully with:
This is because the test is actually defined incorrectly and gets silently ignored by the test runner!
It should be:
module MyTests
open Xunit
[<Fact>
let ``this test always fails`` () =
Assert.True(false)
(Notice that the test is now a function by adding ())
This will compile and then fail as expected.
Ideally, the first version should not compile at all, thus avoiding this very subtle bug.
nuget xunit 2.4.1
nuget xunit.runner.console 2.4.1
nuget xunit.runner.visualstudio 2.4.1
Suppose I have a test like this:
Then I can build and run my tests successfully with:
This is because the test is actually defined incorrectly and gets silently ignored by the test runner!
It should be:
(Notice that the test is now a function by adding
())This will compile and then fail as expected.
Ideally, the first version should not compile at all, thus avoiding this very subtle bug.