本文整理汇总了C#中ITest.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ITest.ToString方法的具体用法?C# ITest.ToString怎么用?C# ITest.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITest
的用法示例。
在下文中一共展示了ITest.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTestSummary
// NOTE: When test.ToString() displays something less stupid than
// MethodName(Namespace.ClassName) think about changing to that. As it
// is now its impossible to sort the test output.
// The workaround is to use this method.
private static string GetTestSummary(ITest test) {
string nunitInfo = test.ToString();
return test.GetType().Name + "." + nunitInfo.Substring(0, nunitInfo.IndexOf('('));
}
示例2: AddError
/// <summary>
/// Adds the error.
/// </summary>
/// <param name="test">The test.</param>
/// <param name="e">The e.</param>
public void AddError(ITest test, Exception e)
{
Writer.WriteLine("ERROR: " + test.ToString());
Writer.WriteLine(FormatError(e.StackTrace, e.Message));
}
示例3: AddFailure
/// <summary>
/// Adds the failure.
/// </summary>
/// <param name="test">The test.</param>
/// <param name="e">The e.</param>
public void AddFailure(ITest test, AssertionFailedError e)
{
Writer.WriteLine("FAILURE: " + test.ToString());
Writer.WriteLine(FormatError(e.StackTrace, e.Message));
}
示例4: StartTest
/// <summary>
/// Starts the test.
/// </summary>
/// <param name="test">The test.</param>
public void StartTest(ITest test)
{
// TODO: the output from ToString is hard to read, change this to output ClassName.TestName
Writer.WriteLine(test.ToString());
}