Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run xunit test in F#

Tags:

f#

xunit.net

I have Xunit and Xunit(Runner: Visual Studio) installed and he is my simple test:

namespace Testing

    module Tests =
        open Xunit
        open Xunit.Extensions

        [<Fact>]
        let ``just test`` =
                Assert.Equal(1, 1)
                ()

But I can find Xunit in Test -> Window -> Test explorer and Resharper Unit Tests Window.

like image 396
ceth Avatar asked Dec 14 '22 14:12

ceth


1 Answers

It looks like your test is missing the unit type, (), to identify it as a function taking no arguments. If you write your test like this it should show up in the Visual Studio Test Explorer.

[<Fact>]
let ``just test`` () =
    Assert.Equal(1, 1)
like image 179
Daws Avatar answered Dec 29 '22 16:12

Daws