open NUnit.Framework let shouldMatch (f : 'a -> bool) (x : 'a) = if f x then () else raise <| new AssertionException(sprintf "Unexpected result: %A." x) [] type Test() = // concoct some random test scenario [] member __.``test scenario``() = [1..10] |> List.map (fun i -> (i,i % 2 = 0)) |> List.filter snd |> shouldMatch (function _ :: (4,_) :: _ -> true | _ -> false)