Skip to content

Commit

Permalink
Fix: NUnit projects fail or provide warning as `TearDown : System.Inv…
Browse files Browse the repository at this point in the history
…alidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.` (#320)
  • Loading branch information
gasparnagy committed Nov 8, 2024
1 parent a8aeed1 commit ed04d97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit ed04d97

Please sign in to comment.