Created
September 1, 2014 18:40
-
-
Save mausch/8943d1b0f884f88bd8ae to your computer and use it in GitHub Desktop.
This file contains 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
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or try https://github.com/GreanTech/Exude if you insist on using xUnit.