本文整理汇总了C#中ITestContext.ResultsFor方法的典型用法代码示例。如果您正苦于以下问题:C# ITestContext.ResultsFor方法的具体用法?C# ITestContext.ResultsFor怎么用?C# ITestContext.ResultsFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITestContext
的用法示例。
在下文中一共展示了ITestContext.ResultsFor方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute
protected override void execute(IWebElement element, IDictionary<string, object> cellValues, IStep step, ITestContext context)
{
// TODO -- StoryTeller needs to pull this all inside the Cell
if (!cellValues.ContainsKey(_cell.Key))
{
// already caught as a syntax error
return;
}
var handler = ElementHandlers.FindHandler(element);
var expectedValue = cellValues[_cell.Key];
var matchingHandler = handler as IMatchingHandler ?? new BasicMatchingHandler(handler, context);
if (matchingHandler.MatchesData(element, expectedValue))
{
context.IncrementRights();
}
else
{
context.ResultsFor(step).MarkFailure(_cell.Key);
context.IncrementWrongs();
}
context.ResultsFor(step).SetActual(_cell.Key, handler.GetData(CurrentContext, element));
}
示例2: WriteResults
public void WriteResults(ITestContext context)
{
context.ResultsFor(_step).ForExceptionText(writeExceptionText);
rows().Each(row => writeResultsRow(row, context));
_headerRow.FirstChild().AddClass("left-cell");
}
示例3: WriteResults
public void WriteResults(ITestContext context)
{
// This code Dru. If there's an exception in the results, call
// back to the writeExceptionText(string) method to write in
// the exception
context.ResultsFor(_step).ForExceptionText(writeExceptionText);
rows().Each(row => writeResultsRow(row, context));
}
示例4: Execute
public void Execute(IStep containerStep, ITestContext context)
{
var actualObjects = findTheObjects(containerStep, context);
var actualRows = buildActualRows(actualObjects);
var expectedRows = buildExpectedRows(context, containerStep);
var matcher = new SetRowMatcher(expectedRows, actualRows, context);
IList<SetRow> results = Ordered ? matcher.CompareOrdered() : matcher.Compare();
markCounts(context, results);
context.ResultsFor(containerStep).SetResult(results, _leafName);
}
示例5: WriteSetVerificationResults
public void WriteSetVerificationResults(SetVerification verification, ITestContext context)
{
if (verification.Ordered)
{
_headerRow.InsertFirst(new HtmlTag("th").Text("Order"));
}
var results = context.ResultsFor(_step);
results.ForExceptionText(writeExceptionText);
var rows = results.GetResult<IList<SetRow>>(_table.LeafName) ?? new List<SetRow>();
// TODO -- order this the right way
rows.Each(x =>
{
writeVerificationResultRow(x, context, verification.Ordered);
});
}
示例6: WriteResults
public void WriteResults(ITestContext context)
{
write(new Results(this, context));
var results = context.ResultsFor(_step);
if (results.HasErrors())
{
AddClass(HtmlClasses.EXCEPTION);
Next = new ExceptionTag(results.ExceptionText);
}
else
{
if (_sentence.IsFact)
{
var success = (bool)results.GetActual(_sentence.ResultCell.Key);
var className = success ? HtmlClasses.PASS : HtmlClasses.FAIL;
AddClass(className);
}
}
}
示例7: 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);
}
}
示例8: writeResultsRow
private void writeResultsRow(IStep step, ITestContext context)
{
AddBodyRow(row =>
{
StepResults results = context.ResultsFor(step);
results.Collapse();
_writer.DisplayCells.Each(cell =>
{
var tag = new CellTag(cell, step);
tag.TagName("td");
row.Append(tag);
tag.WriteResults(results, context);
});
row.FirstChild().AddClass("left-cell");
results.ForExceptionText(writeExceptionText);
});
}
示例9: WriteResults
public void WriteResults(ITestContext context)
{
context.ResultsFor(_section).ForExceptionText(text => _body.Append(new ExceptionTag(text)));
}
示例10: WriteResults
public void WriteResults(ITestContext context)
{
context.ResultsFor(_step).ForExceptionText(text => Child(new ExceptionTag(text)));
}
示例11: Results
public Results(SentenceTag tag, ITestContext context)
{
_tag = tag;
_context = context;
_results = _context.ResultsFor(tag._step);
_step = tag._step;
}
示例12: writeResultsRow
private void writeResultsRow(IStep step, ITestContext context)
{
AddBodyRow(row =>
{
_table.Cells.Each(cell =>
{
StepResults results = context.ResultsFor(step);
var tag = new CellTag(cell, _step);
tag.WriteResults(results, context);
// Ditto this line of code
results.ForExceptionText(writeExceptionText);
row.Cell().Child(tag);
});
});
}