public static IEnumerable <ITestCommand> Make(ITestClassCommand classCommand, IMethodInfo method) { foreach (var testCommand in classCommand.EnumerateTestCommands(method)) { ITestCommand wrappedCommand = testCommand; // Timeout (if they have one) -> Capture -> Timed -> Lifetime (if we need an instance) -> BeforeAfter wrappedCommand = new BeforeAfterCommand(wrappedCommand, method.MethodInfo); if (testCommand.ShouldCreateInstance) { wrappedCommand = new LifetimeCommand(wrappedCommand, method); } wrappedCommand = new TimedCommand(wrappedCommand); wrappedCommand = new ExceptionCaptureCommand(wrappedCommand, method); if (wrappedCommand.Timeout > 0) { wrappedCommand = new TimeoutCommand(wrappedCommand, wrappedCommand.Timeout, method); } yield return(wrappedCommand); } }
public static IEnumerable<ITestCommand> Make(ITestClassCommand classCommand, IMethodInfo method) { foreach (var testCommand in classCommand.EnumerateTestCommands(method)) { ITestCommand wrappedCommand = testCommand; // Timeout (if they have one) -> Capture -> Timed -> Lifetime (if we need an instance) -> BeforeAfter wrappedCommand = new BeforeAfterCommand(wrappedCommand, method.MethodInfo); if (testCommand.ShouldCreateInstance) { wrappedCommand = new LifetimeCommand(wrappedCommand, method); } wrappedCommand = new TimedCommand(wrappedCommand); wrappedCommand = new ExceptionCaptureCommand(wrappedCommand, method); if (wrappedCommand.Timeout > 0) { wrappedCommand = new TimeoutCommand(wrappedCommand, wrappedCommand.Timeout, method); } yield return wrappedCommand; } }