Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#r @"c:\prg\Fuchu\Fuchu\bin\Debug\Fuchu.dll" // https://www.nuget.org/packages/Fuchu/
open System
open Fuchu
// Write your tests as a list of string * Async<unit>
let tests = [
"Check google response", async {
use client = new System.Net.WebClient()
let! a = client.AsyncDownloadString (Uri("http://www.google.com"))
Assert.StringContains("google response", expectedSubString = "Google", actual = a)
}
"Check Bing response", async {
use client = new System.Net.WebClient()
let! a = client.AsyncDownloadString (Uri("http://www.bing.com"))
Assert.StringContains("bing response", expectedSubString = "Microsoft", actual = a)
}
]
// Then run them
tests |> Seq.map (fun (n,a) -> testCase n (fun () -> Async.RunSynchronously a)) |> TestList |> runParallel
@mausch

This comment has been minimized.

Copy link
Owner Author

commented Sep 1, 2014

Or try https://github.com/GreanTech/Exude if you insist on using xUnit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.