protected internal override TestResult RunImpl(ITestCommand rootTestCommand, Model.Tree.TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor) { using (progressMonitor.BeginTask("Running tests.", rootTestCommand.TestCount)) { // Note: We do not check options.SkipTestExecution here because we want to build up // the tree of data-driven test steps. So we actually check it later on in the // PatternTestExecutor. This is different from framework adapters // at this time (because they do not generally support dynamically generated data-driven tests). Sandbox sandbox = new Sandbox(); EventHandler canceledHandler = delegate { sandbox.Abort(TestOutcome.Canceled, "The user canceled the test run."); }; try { progressMonitor.Canceled += canceledHandler; TestAssemblyExecutionParameters.Reset(); PatternTestExecutor executor = new PatternTestExecutor(options, progressMonitor, formatter, converter, environmentManager); // Inlined to minimize stack depth. var action = executor.CreateActionToRunTest(rootTestCommand, parentTestStep, sandbox, null); action.Run(); return(action.Result); } finally { progressMonitor.Canceled -= canceledHandler; sandbox.Dispose(); } } }
public RunTestAction(PatternTestExecutor executor, ITestCommand testCommand, Model.Tree.TestStep parentTestStep, Sandbox parentSandbox, PatternTestActionsDecorator testActionsDecorator) { this.executor = executor; this.testCommand = testCommand; this.parentTestStep = parentTestStep; this.parentSandbox = parentSandbox; this.testActionsDecorator = testActionsDecorator; result = new TestResult(TestOutcome.Error); }
public RunTestDataItemAction(PatternTestExecutor executor, ITestCommand testCommand, PatternTestState testState, TestContext primaryContext, bool reusePrimaryTestStep, IDataItem bindingItem) { this.executor = executor; this.testCommand = testCommand; this.testState = testState; this.primaryContext = primaryContext; this.reusePrimaryTestStep = reusePrimaryTestStep; this.bindingItem = bindingItem; outcome = TestOutcome.Skipped; }
protected internal override TestResult RunImpl(ITestCommand rootTestCommand, Model.Tree.TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor) { using (progressMonitor.BeginTask("Running tests.", rootTestCommand.TestCount)) { // Note: We do not check options.SkipTestExecution here because we want to build up // the tree of data-driven test steps. So we actually check it later on in the // PatternTestExecutor. This is different from framework adapters // at this time (because they do not generally support dynamically generated data-driven tests). Sandbox sandbox = new Sandbox(); EventHandler canceledHandler = delegate { sandbox.Abort(TestOutcome.Canceled, "The user canceled the test run."); }; try { progressMonitor.Canceled += canceledHandler; TestAssemblyExecutionParameters.Reset(); PatternTestExecutor executor = new PatternTestExecutor(options, progressMonitor, formatter, converter, environmentManager); // Inlined to minimize stack depth. var action = executor.CreateActionToRunTest(rootTestCommand, parentTestStep, sandbox, null); action.Run(); return action.Result; } finally { progressMonitor.Canceled -= canceledHandler; sandbox.Dispose(); } } }
public RunTestInstanceAction(PatternTestExecutor executor, ITestCommand testCommand) { this.executor = executor; this.testCommand = testCommand; }
public RunTestAction(PatternTestExecutor executor, ITestCommand testCommand, TestContext parentContext, PatternTestActionsDecorator testActionsDecorator) : this(executor, testCommand, parentContext.TestStep, parentContext.Sandbox, testActionsDecorator) { this.parentContext = parentContext; }