private static TestResult ExecuteSuiteCommand(TestSuiteCommand command, TestExecutionContext context) { //return command.Execute(context); TestSuiteResult suiteResult = context.CurrentResult as TestSuiteResult; System.Diagnostics.Debug.Assert(suiteResult != null); bool oneTimeSetUpComplete = false; try { // Temporary: this should be done by individual commands ApplyTestSettingsToExecutionContext(command.Test, context); command.DoOneTimeSetUp(context); oneTimeSetUpComplete = true; // SetUp may have changed some things context.Update(); suiteResult = RunChildCommands(command, context); } catch (Exception ex) { if (ex is NUnitException || ex is System.Reflection.TargetInvocationException) { ex = ex.InnerException; } if (oneTimeSetUpComplete) { suiteResult.RecordException(ex); } else { suiteResult.RecordException(ex, FailureSite.SetUp); } } finally { command.DoOneTimeTearDown(context); } return(suiteResult); }
private static TestResult ExecuteSuiteCommand(TestSuiteCommand command, TestExecutionContext context) { TestSuiteResult testSuiteResult = context.CurrentResult as TestSuiteResult; Debug.Assert(testSuiteResult != null); bool flag = false; try { ApplyTestSettingsToExecutionContext(command.Test, context); command.DoOneTimeSetUp(context); flag = true; context.Update(); testSuiteResult = RunChildCommands(command, context); } catch (Exception innerException) { if (innerException is NUnitException || innerException is TargetInvocationException) { innerException = innerException.InnerException; } if (flag) { testSuiteResult.RecordException(innerException); } else { testSuiteResult.RecordException(innerException, FailureSite.SetUp); } } finally { command.DoOneTimeTearDown(context); } return(testSuiteResult); }
private static TestResult ExecuteSuiteCommand(TestSuiteCommand command, TestExecutionContext context) { //return command.Execute(context); TestSuiteResult suiteResult = context.CurrentResult as TestSuiteResult; System.Diagnostics.Debug.Assert(suiteResult != null); bool oneTimeSetUpComplete = false; try { // Temporary: this should be done by individual commands ApplyTestSettingsToExecutionContext(command.Test, context); command.DoOneTimeSetUp(context); oneTimeSetUpComplete = true; // SetUp may have changed some things context.Update(); suiteResult = RunChildCommands(command, context); } catch (Exception ex) { if (ex is NUnitException || ex is System.Reflection.TargetInvocationException) ex = ex.InnerException; if (oneTimeSetUpComplete) suiteResult.RecordException(ex); else suiteResult.RecordException(ex, FailureSite.SetUp); } finally { command.DoOneTimeTearDown(context); } return suiteResult; }