diff --git a/CHANGELOG.md b/CHANGELOG.md index db6e9bcc1..8311eca5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ ## Bug fixes: -*Contributors of this release (in alphabetical order):* +* Fix: NUnit projects fail or provide warning as `TearDown : System.InvalidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.` (#320) + +*Contributors of this release (in alphabetical order):* @gasparnagy # v2.2.0 - 2024-11-07 diff --git a/Reqnroll.Generator/UnitTestProvider/NUnit3TestGeneratorProvider.cs b/Reqnroll.Generator/UnitTestProvider/NUnit3TestGeneratorProvider.cs index 34cfd81e0..1d881bd4c 100644 --- a/Reqnroll.Generator/UnitTestProvider/NUnit3TestGeneratorProvider.cs +++ b/Reqnroll.Generator/UnitTestProvider/NUnit3TestGeneratorProvider.cs @@ -57,7 +57,7 @@ public virtual void SetTestClassInitializeMethod(TestClassGenerationContext gene public virtual void SetTestClassCleanupMethod(TestClassGenerationContext generationContext) { - generationContext.TestClassInitializeMethod.Attributes |= MemberAttributes.Static; + generationContext.TestClassCleanupMethod.Attributes |= MemberAttributes.Static; CodeDomHelper.AddAttribute(generationContext.TestClassCleanupMethod, TESTFIXTURETEARDOWN_ATTR_NUNIT3); }