Skip to content

0x53A/Expecto.Xunit

Repository files navigation

Expecto.Xunit

How to use

Declare your tests normally with expecto, and add one dummy method with the Attribute:

open Expecto

module Tests =

    [<Expecto.XUnit.ExpectoBridge>]
    let dummy() = ()
    
    [<Tests>]
    let tests1 =
      test "A simple test" {
        let subject = "Hello World"
        Expect.equal subject "Hello World" "The strings should equal"
      }

    [<Tests>]
    let tests2 =
      test "A failing test" {
        let subject = "Hello world2"
        Expect.equal subject "Hello World" "The strings should equal"
      }

image

image

Fixing no tests found

If the xunit runner doesn't find any tests, then the issue may be a missing (or incorrect) binding redirect for FSharp.Core.

Modify the app.config for the unit test project: https://fsharp.github.io/2015/04/18/fsharp-core-notes.html#use-binding-redirects-for-applications (and make sure the version number is the one that is actually referenced by your project.)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages