AfterTestCommand
AfterCommand is a DelegatingTestCommand that performs some
specific action after the inner command is run.
using System;
namespace NUnit.Framework.Internal.Commands
{
public abstract class AfterTestCommand : DelegatingTestCommand
{
protected Action<TestExecutionContext> AfterTest;
public AfterTestCommand(TestCommand innerCommand)
: base(innerCommand)
{
}
public override TestResult Execute(TestExecutionContext context)
{
Guard.OperationValid(AfterTest != null, "AfterTest was not set by the derived class constructor");
innerCommand.Execute(context);
AfterTest(context);
return context.CurrentResult;
}
}
}