Skip to content

Parametrized tests do not respect FixtureLifeCycle.InstancePerTestCase #3743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gleb-osokin opened this issue Jan 26, 2021 · 0 comments · Fixed by #3744
Closed

Parametrized tests do not respect FixtureLifeCycle.InstancePerTestCase #3743

gleb-osokin opened this issue Jan 26, 2021 · 0 comments · Fixed by #3744
Labels
Milestone

Comments

@gleb-osokin
Copy link

This applies to (at least) TestCase, TestCaseSource, Theory and Values attributes.

Simple test example that fails:

    [FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
    public class FixtureWithTestCases
    {
        private int _counter;

        [TestCase(0)]
        [TestCase(1)]
        [TestCase(2)]
        [TestCase(3)]
        public void Test(int _)
        {
            Assert.AreEqual(0, _counter++);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants