forked from SolrNet/SolrNet
/
Tests.fsx
40 lines (33 loc) · 1.09 KB
/
Tests.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#I "lib"
#r @"gallio.dll"
#r @"MbUnit.dll"
#r @"packages\Fuchu.0.3.0.1\lib\net40-client\Fuchu.dll"
#r @"SolrNet.Tests\bin\Debug\SolrNet.Tests.dll"
open System
open System.Globalization
open System.Threading
open Fuchu
open SolrNet.Tests
let withCulture culture f x =
let c = Thread.CurrentThread.CurrentCulture
try
Thread.CurrentThread.CurrentCulture <- culture
f x
finally
Thread.CurrentThread.CurrentCulture <- c
let testWithCultures (cultures: #seq<CultureInfo>) =
Test.replaceTestCode <| fun name test ->
testList name [
for c in cultures ->
testCase c.Name (withCulture c test)
]
//let test =
// typeof<SolrQueryResultsParserTests>.Assembly.GetExportedTypes()
// |> Seq.filter (fun (t: Type) -> not t.IsAbstract)
// |> Seq.map Fuchu.MbUnit.MbUnitTestToFuchu
// |> TestList
let test =
Fuchu.MbUnit.MbUnitTestToFuchu typeof<CollapseResponseParserTests>
//|> Test.filter (fun s -> s.Contains "ParseResultsWithGroups")
//|> testWithCultures [CultureInfo "en-US"; CultureInfo "fr-FR"]
run test