Skip to content

Allow static SetUpFixture classes #3166

Closed
@jnm2

Description

@jnm2

As long as the setup and teardown methods are static, no instance should be created and therefore static and abstract classes and classes without constructors should work, just like OneTimeTearDown with a non-[SetUpFixture] class.

[SetUpFixture]
public static class AcceptanceTestsTeardownFixture
{
    [OneTimeTearDown]
    public static void OneTimeTearDown()
    {
        AcceptanceTests.OnGlobalTeardown();
    }
}

It currently fails all tests with:

OneTimeSetUp: NUnit.VisualStudio.TestAdapter.Tests.Acceptance.AcceptanceTestsTeardownFixture is an abstract class

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions