Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
            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);
            }
Ejemplo n.º 3
0
            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();
                }
            }
        }
Ejemplo n.º 5
0
 public RunTestInstanceAction(PatternTestExecutor executor, ITestCommand testCommand)
 {
     this.executor = executor;
     this.testCommand = testCommand;
 }
Ejemplo n.º 6
0
            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;
            }
Ejemplo n.º 7
0
 public RunTestAction(PatternTestExecutor executor, ITestCommand testCommand, TestContext parentContext, PatternTestActionsDecorator testActionsDecorator)
     : this(executor, testCommand, parentContext.TestStep, parentContext.Sandbox, testActionsDecorator)
 {
     this.parentContext = parentContext;
 }
Ejemplo n.º 8
0
            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);
            }
Ejemplo n.º 9
0
 public RunTestInstanceAction(PatternTestExecutor executor, ITestCommand testCommand)
 {
     this.executor    = executor;
     this.testCommand = testCommand;
 }
Ejemplo n.º 10
0
 public RunTestAction(PatternTestExecutor executor, ITestCommand testCommand, TestContext parentContext, PatternTestActionsDecorator testActionsDecorator)
     : this(executor, testCommand, parentContext.TestStep, parentContext.Sandbox, testActionsDecorator)
 {
     this.parentContext = parentContext;
 }