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

AfterTestActionCommand

TestActionAfterCommand handles the AfterTest method of a single TestActionItem, provided the items BeforeTest has been run.
namespace NUnit.Framework.Internal.Commands { public class AfterTestActionCommand : AfterTestCommand { public AfterTestActionCommand(TestCommand innerCommand, TestActionItem action) : base(innerCommand) { Guard.ArgumentValid(innerCommand.Test is TestSuite, "BeforeTestActionCommand may only apply to a TestSuite", "innerCommand"); Guard.ArgumentNotNull(action, "action"); AfterTest = delegate(TestExecutionContext context) { if (action.BeforeTestWasRun) { int count = context.CurrentResult.AssertionResults.Count; action.AfterTest(base.Test); if (context.CurrentResult.AssertionResults.Count > count) context.CurrentResult.RecordTestCompletion(); } }; } } }