private static bool RunTestCommandAndFinishStep(ITestContext testContext, XunitTestClassCommand testClassCommand, XunitTestCommand testCommand) { try { testContext.LifecyclePhase = LifecyclePhases.Execute; XunitMethodResult result = testCommand.Execute(testClassCommand.ObjectUnderTest); return LogMethodResultAndFinishStep(testContext, result, false); } catch (Exception ex) { // Xunit probably shouldn't throw an exception in a test command. // But just in case... testContext.LogWriter.Failures.WriteException(ex, "Internal Error"); testContext.FinishStep(TestOutcome.Failed, null); return false; } }
private static bool RunTestCommandAndFinishStep(ITestContext testContext, XunitTestClassCommand testClassCommand, XunitTestCommand testCommand) { try { testContext.LifecyclePhase = LifecyclePhases.Execute; XunitMethodResult result = testCommand.Execute(testClassCommand.ObjectUnderTest); return(LogMethodResultAndFinishStep(testContext, result, false)); } catch (Exception ex) { // Xunit probably shouldn't throw an exception in a test command. // But just in case... testContext.LogWriter.Failures.WriteException(ex, "Internal Error"); testContext.FinishStep(TestOutcome.Failed, null); return(false); } }