Skip to content

Assembly level FixtureLifeCycle(LifeCycle.InstancePerTestCase) doesn't work #3716

Closed
@gleb-osokin

Description

@gleb-osokin

LifeCycle.InstancePerTestCase is not applied when set at the assembly level.

Here's a sample test that fails:

using NUnit.Framework;

[assembly: FixtureLifeCycle(LifeCycle.InstancePerTestCase)]

[TestFixture]
public class AssemblyLevelFixtureLifeCycleTest
{
    private int _value;

    [Test]
    public void Test1() => Assert.AreEqual(0, _value++);

    [Test]
    public void Test2() => Assert.AreEqual(0, _value++);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions