Skip to content

Instantly share code, notes, and snippets.

@jsquire
Created February 19, 2018 15:13
Show Gist options
  • Save jsquire/e5deb74c3c8788eb28cce06ecff42589 to your computer and use it in GitHub Desktop.
Save jsquire/e5deb74c3c8788eb28cce06ecff42589 to your computer and use it in GitHub Desktop.
A sample to illustrate the various structures that can be used for tests with F# and FSUnit.
namespace MachineLearningBook.SpamDetector.UnitTests
module SampleTests =
open System
open Xunit
open FsUnit.Xunit
// http://fsprojects.github.io/FsUnit/index.html
// http://fsprojects.github.io/FsUnit/xUnit.html
[<Fact>]
let ``My test`` () =
true |> should be True
let [<Fact>] ``Some Test`` () =
1 |> should not' (equal 2)
type ``Describe a scenario here`` () =
let value = true
[<Fact>] member x.
``when I do something, something is in then right state`` () =
true |> should equal value
[<Fact>]
member verify.``that this thing works because it's cool`` () =
"bob" |> should equal "bob"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment