當前位置: 首頁>>代碼示例>>C#>>正文


C# Core.TestOutput類代碼示例

本文整理匯總了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()));
        }
開發者ID:boinst,項目名稱:boinst-nant,代碼行數:15,代碼來源:TeamCityTestReporterListener.cs

示例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;
            }
        }
開發者ID:alfeg,項目名稱:nunit,代碼行數:17,代碼來源:TestEventAdapter.cs

示例3: TestOutput

 /// <summary>
 /// capture any console output during the testing.
 /// </summary>
 /// <param name="testOutput"></param>
 public void TestOutput(TestOutput testOutput)
 {
     currentTestOutput = testOutput.Text;
 }
開發者ID:christianeisendle,項目名稱:nunit-testlink-adapter,代碼行數:8,代碼來源:ResultExporter.cs

示例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');
 }
開發者ID:kukubadze,項目名稱:nunit-vs-adapter,代碼行數:33,代碼來源:NUnitEventListener.cs

示例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;
				}
			}
		}
開發者ID:Vernathic,項目名稱:ic-AutoTest.NET4CTDD,代碼行數:12,代碼來源:EventListenerTextWriter.cs

示例6:

 void EventListener.TestOutput(TestOutput testOutput)
 {
     this.FireTestOutput(testOutput);
 }
開發者ID:Phaiax,項目名稱:dotnetautoupdate,代碼行數:4,代碼來源:MockTestEventSource.cs

示例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;
			}
		}
開發者ID:Buildstarted,項目名稱:ContinuousTests,代碼行數:12,代碼來源:EventCollector.cs

示例8: TestOutput

 public void TestOutput(TestOutput testOutput)
 {
     Console.WriteLine("output: "+testOutput);
 }
開發者ID:RichIsMyName,項目名稱:PicklingToolsRepo,代碼行數:4,代碼來源:Testrunner.cs

示例9: TestOutput

		public void TestOutput (TestOutput testOutput)
		{
			// Console.WriteLine("TestOutput");
		}
開發者ID:Boerlam001,項目名稱:MonoGame,代碼行數:4,代碼來源:TestEventListenerBase.cs

示例10: TestOutput

 public void TestOutput(TestOutput testOutput)
 {
     Console.WriteLine("TestOutput : {0}", testOutput);
 }
開發者ID:spartanthe,項目名稱:TestPlateSharp,代碼行數:4,代碼來源:LowNUnit.cs

示例11: Write

		public void Write(TestOutput output)
		{
			Write(output.Text);
		}
開發者ID:kobida,項目名稱:nunitv2,代碼行數:4,代碼來源:SimpleTextDisplay.cs

示例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);
            }
開發者ID:dougrathbone,項目名稱:mbunit-v3,代碼行數:24,代碼來源:NUnitTestController.cs

示例13: TestOutput

 public void TestOutput(TestOutput testOutput)
 {
     if (m_testLog != null)
         m_testLog.AppendLine(testOutput.Text);
 }
開發者ID:LostLT,項目名稱:TestTools,代碼行數:5,代碼來源:NUnitTestEngine.cs

示例14: TestOutput

 public void TestOutput(TestOutput output)
 {
     listener.TestOutput (output);
 }
開發者ID:baulig,項目名稱:debugger,代碼行數:4,代碼來源:ProxyListener.cs

示例15: TestOutput

 public void TestOutput(TestOutput testOutput)
 {
     myClient.testOutput(myLastTest, testOutput.Text, testOutput.Type == TestOutputType.Out);
 }
開發者ID:intellisharp,項目名稱:intellisharp-nunit-plugin,代碼行數:4,代碼來源:Program.cs


注:本文中的NUnit.Core.TestOutput類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。