本文整理汇总了C#中Machine.Specifications.Runner.SpecificationInfo类的典型用法代码示例。如果您正苦于以下问题:C# SpecificationInfo类的具体用法?C# SpecificationInfo怎么用?C# SpecificationInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpecificationInfo类属于Machine.Specifications.Runner命名空间,在下文中一共展示了SpecificationInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
var formatter = resultFormatterFactory.GetResultFormatterFor(result);
testListener.WriteLine(formatter.FormatResult(specification), Category.Output);
var testResult = new TestResult();
testResult.Name = specification.Name;
if (result.Passed)
testResult.State = TestState.Passed;
else if (result.Status == Status.Ignored)
{
testResult.State = TestState.Ignored;
testResult.Message = "Ignored";
}
else if (result.Status == Status.NotImplemented)
{
testResult.State = TestState.Ignored;
testResult.Message = "Not Implemented";
}
else
{
testResult.State = TestState.Failed;
if (result.Exception != null)
testResult.StackTrace = result.Exception.ToString();
}
testResults.Add(testResult);
}
示例2: OnSpecificationStart
public void OnSpecificationStart(SpecificationInfo specification)
{
if (listenFor != null && !listenFor.Equals(specification.ToVisualStudioTestIdentifier(currentContext)))
return;
runListener.OnSpecificationStart(specification);
}
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:7,代码来源:SingleBehaviorTestRunListenerWrapper.cs
示例3: OnSpecificationStart
public void OnSpecificationStart(SpecificationInfo specification)
{
if (!_specificationTimer.IsRunning)
{
_specificationTimer.Restart();
}
}
示例4: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
if (listenFor != null && !listenFor.Equals(specification.ToVisualStudioTestIdentifier(currentContext)))
return;
runListener.OnSpecificationEnd(specification, result);
}
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:7,代码来源:SingleBehaviorTestRunListenerWrapper.cs
示例5: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
switch (result.Status)
{
case Status.Passing:
_writer.WriteTestFinished(GetSpecificationName(specification), TimeSpan.Zero);
break;
case Status.NotImplemented:
_writer.WriteTestIgnored(GetSpecificationName(specification), "(Not Implemented)");
break;
case Status.Ignored:
_writer.WriteTestIgnored(GetSpecificationName(specification), "(Ignored)");
break;
default:
if (result.Exception != null)
{
_writer.WriteTestFailed(GetSpecificationName(specification),
result.Exception.Message, result.Exception.StackTrace);
}
else
{
_writer.WriteTestFailed(GetSpecificationName(specification), "FAIL", "");
}
_failureOccured = true;
break;
}
}
示例6: OnSpecificationStart
public void OnSpecificationStart(SpecificationInfo specification)
{
_specifications += 1;
var notify = CreateTaskNotificationFor(specification);
notify(task => _server.TaskStarting(task));
}
示例7: OnSpecificationStart
public void OnSpecificationStart(SpecificationInfo specification)
{
var notify = CreateTaskNotificationFor(specification);
notify(task => _server.TaskStarting(task));
notify(task => _server.TaskProgress(task, "Running specification"));
}
示例8: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
switch (result.Status)
{
case Status.Passing:
break;
case Status.NotImplemented:
_writer.WriteTestIgnored(GetSpecificationName(specification), "(Not Implemented)");
break;
case Status.Ignored:
_writer.WriteTestIgnored(GetSpecificationName(specification), "(Ignored)");
break;
default:
if (result.Exception != null)
{
_writer.WriteTestFailed(GetSpecificationName(specification),
result.Exception.Message,
result.Exception.ToString());
}
else
{
_writer.WriteTestFailed(GetSpecificationName(specification), "FAIL", "");
}
_failureOccurred = true;
break;
}
var duration = TimeSpan.FromMilliseconds(_timingListener.GetSpecificationTime(specification));
_writer.WriteTestFinished(GetSpecificationName(specification), duration);
}
示例9: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
string specName = GetContextSpecName(_currentContext, specification);
switch (result.Status)
{
case Status.Passing:
break;
case Status.Failing:
_messageProvider.TestFailed(specName,
result.Exception.Message,
result.Exception.StackTrace,
result.Exception.FullTypeName);
break;
case Status.Ignored:
_messageProvider.TestIgnored(specName, null);
break;
case Status.NotImplemented:
_messageProvider.TestIgnored(specName, "Not implemented");
break;
default:
break;
}
_messageProvider.TestFinished(specName);
}
示例10: OnSpecificationEnd
public void OnSpecificationEnd(SpecificationInfo specification, Result result)
{
_specificationRunCounter.IncrementSpecificationCount();
if(result.Supplements.Any())
{
_outputAction(IndicateSupplement.ToString());
return;
}
switch (result.Status)
{
case Status.Passing:
_specificationRunCounter.IncrementPasses();
_outputAction(IndicatePass.ToString());
break;
case Status.Ignored:
_outputAction(IndicateIgnored.ToString());
break;
case Status.NotImplemented:
_outputAction(IndicateNotImplemented.ToString());
break;
default:
if(!_contextMap.ContainsKey(_currentContextName))
{
_contextMap.Add(_currentContextName, new List<SpecificationFailureDetails>());
}
var failedSpecName = specification != null ? specification.Name : "UNDEFINED SPECIFICATION";
var details = new SpecificationFailureDetails(failedSpecName, result.Exception.Message);
_specificationRunCounter.IncrementFailures();
_outputAction(IndicateFailure.ToString());
_contextMap[_currentContextName].Add(details);
break;
}
}
示例11: ConvertSpecificationToTestCase
private TestCase ConvertSpecificationToTestCase(SpecificationInfo specification, Settings settings)
{
VisualStudioTestIdentifier vsTestId = specification.ToVisualStudioTestIdentifier(currentContext);
return new TestCase(vsTestId.FullyQualifiedName, this.executorUri, this.assemblyPath) {
DisplayName = settings.DisableFullTestNameInOutput ? specification.Name : $"{this.currentContext?.TypeName}.{specification.FieldName}",
};
}
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:8,代码来源:VSProxyAssemblySpecificationRunListener.cs
示例12: Failed
public void Failed(SpecificationInfo specification, Result result)
{
Color(ConsoleColor.Red, () =>
{
_inner.SpecificationStart(specification);
_inner.Failed(specification, result);
});
}
示例13: Ignored
public void Ignored(SpecificationInfo specification)
{
Color(ConsoleColor.Yellow, () =>
{
_inner.SpecificationStart(specification);
_inner.Ignored(specification);
});
}
示例14: NotImplemented
public void NotImplemented(SpecificationInfo specification)
{
Color(ConsoleColor.Gray, () =>
{
_inner.SpecificationStart(specification);
_inner.NotImplemented(specification);
});
}
示例15: Passing
public void Passing(SpecificationInfo specification)
{
Color(ConsoleColor.Green, () =>
{
_inner.SpecificationStart(specification);
_inner.Passing(specification);
});
}