Skip to content

Instantly share code, notes, and snippets.


Stephen Swensen stephen-swensen

View GitHub Profile
View gist:2919920
//Unquote ( solution to
//The following example is shown in FSI, but unquote works configuration free with NUnit,, and all other exception-based unit testing frameworks.
#r @"C:\Unquote.dll"
open Swensen.Unquote
let x = [1;5;3;1;2;4]
let y = [4;3;5;2;1]
test <@ List.sort x = List.sort y @>
stephen-swensen / gist:2366849
Created Apr 12, 2012
Demonstrate asserting a function returns Some using Unquote
View gist:2366849
//here is the function we'd like to test
let testedFunc() = None:option<int>
//here is our Unquote assertion function (using, but can use any unit testing framework such as NUnit)
let ``tested func does not return None`` () =
test <@ testedFunc() |> Option.isSome @>
//here is the output from the failing assertion