本文整理汇总了C#中NUnit.Core.TestOutput类的典型用法代码示例。如果您正苦于以下问题:C# TestOutput类的具体用法?C# TestOutput怎么用?C# TestOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestOutput类属于NUnit.Core命名空间,在下文中一共展示了TestOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestOutput
public void TestOutput(TestOutput testOutput)
{
if (this.currentTest == null) return;
// Ignore TeamCity control messages. These are probably our own messages anyway.
if (testOutput.Text.ToLowerInvariant().Contains("##teamcity")) return;
// Ignore blank messages, or messages that consist of empty lines.
if (string.IsNullOrWhiteSpace(testOutput.Text)) return;
if (testOutput.Type == TestOutputType.Error)
Console.WriteLine(TeamCityMessageFormatter.FormatTestErrorMessage(this.currentTest, testOutput.Text.Trim()));
else if (testOutput.Type != TestOutputType.Trace)
Console.WriteLine(TeamCityMessageFormatter.FormatTestOutputMessage(this.currentTest, testOutput.Text.Trim()));
}
示例2: switch
void EventListener.TestOutput(TestOutput testOutput)
{
switch (testOutput.Type)
{
case TestOutputType.Out:
_testOutput.Append(testOutput.Text);
break;
case TestOutputType.Error:
Console.Error.Write(testOutput.Text);
break;
default:
// Ignore any other output type
break;
}
}
示例3: TestOutput
/// <summary>
/// capture any console output during the testing.
/// </summary>
/// <param name="testOutput"></param>
public void TestOutput(TestOutput testOutput)
{
currentTestOutput = testOutput.Text;
}
示例4: TestOutput
public void TestOutput(TestOutput testOutput)
{
string message = testOutput.Text;
int length = message.Length;
int drop = message.EndsWith(Environment.NewLine)
? Environment.NewLine.Length
: message[length - 1] == '\n' || message[length - 1] == '\r'
? 1
: 0;
if (drop > 0)
message = message.Substring(0, length - drop);
message = message.Trim();
if (!string.IsNullOrEmpty(message))
testLog.SendMessage(TestMessageLevel.Informational, message);
string type="";
// Consider adding this later, as an option.
//switch (testOutput.Type)
//{
// case TestOutputType.Trace:
// type ="Debug: ";
// break;
// case TestOutputType.Out:
// type ="Console: ";
// break;
// case TestOutputType.Log:
// type="Log: ";
// break;
// case TestOutputType.Error:
// type="Error: ";
// break;
//}
this.Output += (type+message+'\r');
}
示例5: Flush
override public void Flush()
{
if ( sb.Length > 0 )
{
lock( sb )
{
TestOutput output = new TestOutput(sb.ToString(), this.type);
this.eventListener.TestOutput( output );
sb.Length = 0;
}
}
}
示例6:
void EventListener.TestOutput(TestOutput testOutput)
{
this.FireTestOutput(testOutput);
}
示例7: TestOutput
public void TestOutput( TestOutput output)
{
switch ( output.Type )
{
case TestOutputType.Out:
outWriter.Write( output.Text );
break;
case TestOutputType.Error:
errorWriter.Write( output.Text );
break;
}
}
示例8: TestOutput
public void TestOutput(TestOutput testOutput)
{
Console.WriteLine("output: "+testOutput);
}
示例9: TestOutput
public void TestOutput (TestOutput testOutput)
{
// Console.WriteLine("TestOutput");
}
示例10: TestOutput
public void TestOutput(TestOutput testOutput)
{
Console.WriteLine("TestOutput : {0}", testOutput);
}
示例11: Write
public void Write(TestOutput output)
{
Write(output.Text);
}
示例12: switch
void EventListener.TestOutput(TestOutput testOutput)
{
if (testContextStack.Count == 0)
return;
ITestContext testContext = testContextStack.Peek();
string streamName;
switch (testOutput.Type)
{
default:
case TestOutputType.Out:
streamName = MarkupStreamNames.ConsoleOutput;
break;
case TestOutputType.Error:
streamName = MarkupStreamNames.ConsoleError;
break;
case TestOutputType.Trace:
streamName = MarkupStreamNames.DebugTrace;
break;
}
testContext.LogWriter[streamName].Write(testOutput.Text);
}
示例13: TestOutput
public void TestOutput(TestOutput testOutput)
{
if (m_testLog != null)
m_testLog.AppendLine(testOutput.Text);
}
示例14: TestOutput
public void TestOutput(TestOutput output)
{
listener.TestOutput (output);
}
示例15: TestOutput
public void TestOutput(TestOutput testOutput)
{
myClient.testOutput(myLastTest, testOutput.Text, testOutput.Type == TestOutputType.Out);
}