namespace Consumer open System.Threading open FsUnitTyped open NUnit.Framework [] module NonStaticTestHelpers = let count = ref 0 [] type TestNonStatic () = let count = ref 0 member this.Thing = "i'm a thing" [] member this.Foo () = Interlocked.Increment NonStaticTestHelpers.count |> ignore Interlocked.Increment count |> ignore this.Thing |> shouldEqual "i'm a thing" [] static member AnotherTest () = Interlocked.Increment NonStaticTestHelpers.count |> ignore 1 |> shouldEqual 1 [] member _.TearDown () = count.Value |> shouldEqual 1 NonStaticTestHelpers.count.Value |> shouldEqual 2