forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tests.fsx
45 lines (38 loc) · 1.3 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
41
42
43
44
45
#I "lib"
#r "System.Configuration"
#r @"gallio.dll"
#r @"MbUnit.dll"
#r @"packages\Fuchu.0.4.0.0\lib\Fuchu.dll"
#r @"SolrNet.Tests\bin\Debug\SolrNet.Tests.dll"
#r @"SolrNet.Tests.Integration\bin\Debug\SolrNet.Tests.Integration.dll"
open System
open System.Globalization
open System.Threading
open Fuchu
open SolrNet.Tests
open SolrNet.Tests.Integration
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 solrUrl = "http://localhost:8983/solr"
System.Configuration.ConfigurationManager.AppSettings.["solr"] <- solrUrl
let test =
Fuchu.MbUnit.MbUnitTestToFuchu typeof<SolrQueryExecuterTests>
|> Test.filter (fun s -> s.Contains "Highlighting")
//|> testWithCultures [CultureInfo "en-US"; CultureInfo "fr-FR"]
run test