Created
February 19, 2018 15:13
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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