Cope without the TestFixture attribute (#37)

This commit is contained in:
Patrick Stevens
2024-06-06 20:58:45 +01:00
committed by GitHub
parent c6f339c738
commit 00e2b027c7
3 changed files with 10 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="NoAttribute.fs" />
<Compile Include="TestSetUp.fs" />
<Compile Include="TestValues.fs" />
<None Include="some-config.json">

9
Consumer/NoAttribute.fs Normal file
View File

@@ -0,0 +1,9 @@
namespace Consumer
open NUnit.Framework
open FsUnitTyped
module NoAttribute =
[<Test>]
let foo () = 1 |> shouldEqual 1

View File

@@ -36,11 +36,6 @@ module Program =
let anyFailures =
assy.ExportedTypes
// TODO: NUnit nowadays doesn't care if you're a TestFixture or not
|> Seq.filter (fun ty ->
ty.CustomAttributes
|> Seq.exists (fun attr -> attr.AttributeType.FullName = "NUnit.Framework.TestFixtureAttribute")
)
|> Seq.fold
(fun anyFailures ty ->
let testFixture = TestFixture.parse ty