Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 1.17 KB

README.md

File metadata and controls

44 lines (27 loc) · 1.17 KB

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.)