本文整理汇总了C#中ITestContext.GetDisplay方法的典型用法代码示例。如果您正苦于以下问题:C# ITestContext.GetDisplay方法的具体用法?C# ITestContext.GetDisplay怎么用?C# ITestContext.GetDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITestContext
的用法示例。
在下文中一共展示了ITestContext.GetDisplay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteResults
public void WriteResults(StepResults results, ITestContext context)
{
if (!_cell.IsResult)
{
WritePreview(context);
return;
}
var actual = results.HasActual(_cell.Key) ? results.GetActual(_cell.Key) : "MISSING";
if (results.IsInException(_cell.Key))
{
Text("Error!");
AddClass(HtmlClasses.EXCEPTION);
return;
}
if (results.IsFailure(_cell.Key))
{
var expected = _step.Get(_cell.Key);
string text = "{0}, but was '{1}'".ToFormat(expected, actual);
Text(text);
AddClass(HtmlClasses.FAIL);
}
else
{
Text(context.GetDisplay(actual));
AddClass(HtmlClasses.PASS);
}
}
示例2: WritePreview
public void WritePreview(ITestContext context)
{
string display = _cell.GetDisplay(_step);
Text(context.GetDisplay(display));
}
示例3: writeVerificationResultRow
private void writeVerificationResultRow(SetRow setRow, ITestContext context, bool ordered)
{
AddBodyRow(row =>
{
if (ordered)
{
row.Cell(setRow.ActualOrder == 0 ? string.Empty : setRow.ActualOrder.ToString());
}
_table.Cells.Each(cell =>
{
var display = context.GetDisplay(setRow.Values[cell.Key]);
row.Cell(display);
});
switch (setRow.Result)
{
case SetMatch.Match:
row.AddClass(HtmlClasses.PASS);
break;
case SetMatch.Extra:
row.AddClass(HtmlClasses.FAIL);
var firstChild = row.FirstChild();
firstChild.Text("Extra: " + firstChild.Text());
break;
case SetMatch.Missing:
row.AddClass(HtmlClasses.FAIL);
var tag = row.FirstChild();
tag.Text("Missing: " + tag.Text());
break;
case SetMatch.OutOfOrder:
row.AddClass(HtmlClasses.FAIL);
string text = "Expected {0} but was {1}".ToFormat(setRow.ExpectedOrder, setRow.ActualOrder);
row.FirstChild().Text(text);
break;
}
row.FirstChild().AddClass("left-cell");
});
if (setRow.Step != null)
{
context.ResultsFor(setRow.Step).ForExceptionText(writeExceptionText);
}
}