<PackageReference Include="NUnit" Version="3.13.2" />

ITestAction

public interface ITestAction
When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.

Provides the target for the action attribute

void AfterTest(ITest test)

Executed after each test is run

void BeforeTest(ITest test)

Executed before each test is run