-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSetup.fs
More file actions
30 lines (24 loc) · 971 Bytes
/
Setup.fs
File metadata and controls
30 lines (24 loc) · 971 Bytes
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
module Tests.Setup
open Fixie
open System
open System.Collections.Generic
open System.Reflection
[<AttributeUsage(AttributeTargets.Method)>]
type TestAttribute() =
inherit Attribute()
[<AttributeUsage(AttributeTargets.Method)>]
type FocusTestAttribute() =
inherit Attribute()
type TestModuleDiscovery() =
interface IDiscovery with
member this.TestClasses(concreteClasses: IEnumerable<Type>) =
concreteClasses
|> Seq.filter (fun cls ->
cls.GetMembers() |> Seq.exists (fun m -> m.Has<TestAttribute>())
)
member this.TestMethods(publicMethods: IEnumerable<MethodInfo>) =
publicMethods |> Seq.filter (fun x -> x.Has<TestAttribute>() && x.IsStatic)
type TestProject() =
interface ITestProject with
member _.Configure(configuration: TestConfiguration, environment: TestEnvironment) =
configuration.Conventions.Add<TestModuleDiscovery, DefaultExecution>()