本文整理汇总了C#中ITestCommand.StartStep方法的典型用法代码示例。如果您正苦于以下问题:C# ITestCommand.StartStep方法的具体用法?C# ITestCommand.StartStep怎么用?C# ITestCommand.StartStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITestCommand
的用法示例。
在下文中一共展示了ITestCommand.StartStep方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunTestCommands
private static bool RunTestCommands(ITestCommand testCommand, XunitTestClassCommand testClassCommand,
IEnumerable<XunitTestCommand> xunitTestCommands, TestStep parentTestStep, bool isPrimary)
{
bool passed = true;
foreach (XunitTestCommand xunitTestCommand in xunitTestCommands)
{
TestStep testStep = new TestStep(testCommand.Test, parentTestStep,
testCommand.Test.Name, testCommand.Test.CodeElement, isPrimary);
testStep.IsDynamic = !isPrimary;
string displayName = xunitTestCommand.DisplayName;
if (displayName != null)
testStep.Name = StripTypeNamePrefixFromDisplayName(testCommand.Test.CodeElement, displayName);
ITestContext testContext = testCommand.StartStep(testStep);
passed &= RunTestCommandAndFinishStep(testContext, testClassCommand, xunitTestCommand);
}
return passed;
}
示例2: PublishOutcomeFromInvisibleTest
private static TestResult PublishOutcomeFromInvisibleTest(ITestCommand testCommand, Model.Tree.TestStep testStep, TestOutcome outcome)
{
switch (outcome.Status)
{
case TestStatus.Skipped:
case TestStatus.Passed:
// Either nothing interesting happened or the test was silently skipped during Before/After.
return new TestResult(TestOutcome.Passed);
case TestStatus.Failed:
case TestStatus.Inconclusive:
default:
// Something bad happened during Before/After that prevented the test from running.
ITestContext context = testCommand.StartStep(testStep);
context.LogWriter.Failures.Write("The test did not run. Consult the parent test log for more details.");
return context.FinishStep(outcome, null);
}
}
示例3: SafeStartCommandStep
private static ITestContext SafeStartCommandStep(ITestContext parentTestContext, ITestCommand testCommand, TestStep testStep)
{
using (TestContextTrackerAccessor.Instance.EnterContext(parentTestContext))
return testCommand.StartStep(testStep);
}