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;
         }
     }
 }
        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()));
        }
示例#3
0
        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;
            }
        }
 /// <summary>
 /// capture any console output during the testing.
 /// </summary>
 /// <param name="testOutput"></param>
 public void TestOutput(TestOutput testOutput)
 {
     currentTestOutput = testOutput.Text;
 }
 /// <summary>
 /// A message has been output to the console.
 /// </summary>
 /// <param name="testOutput">A console message</param>
 public void TestOutput(TestOutput output)
 {
     events.Enqueue(new OutputEvent(output));
 }
		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;
				}
			}
		}
 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');
 }
		public void TestOutput( TestOutput output)
		{
			switch ( output.Type )
			{
				case TestOutputType.Out:
					outWriter.Write( output.Text );
					break;
				case TestOutputType.Error:
					errorWriter.Write( output.Text );
					break;
			}
		}
 void EventListener.TestOutput(TestOutput testOutput)
 {
     this.FireTestOutput(testOutput);
 }
示例#10
0
文件: Program.cs 项目: sbambach/ATF
 public void TestOutput(TestOutput testOutput)
 {
     Console.WriteLine(testOutput.Text);
 }
 public void TestOutput(TestOutput testOutput)
 {
     Console.WriteLine("output: "+testOutput);
 }
示例#12
0
 public void TestOutput(TestOutput testOutput)
 {
     Console.WriteLine("TestOutput : {0}", testOutput);
 }
示例#13
0
		public void TestOutput (TestOutput testOutput)
		{
			if (consoleOutput == null) {
				Console.WriteLine (testOutput.Text);
				return;
			}
			else if (testOutput.Type == TestOutputType.Out)
				consoleOutput.Append (testOutput.Text);
			else
				consoleError.Append (testOutput.Text);
		}
示例#14
0
		public void Write(TestOutput output)
		{
			Write(output.Text);
		}
            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);
            }
示例#16
0
 public void TestOutput(TestOutput testOutput)
 {
     if (m_testLog != null)
         m_testLog.AppendLine(testOutput.Text);
 }
示例#17
0
 public void TestOutput(TestOutput output)
 {
     listener.TestOutput (output);
 }
 public void TestOutput(TestOutput testOutput)
 {
     myClient.testOutput(myLastTest, testOutput.Text, testOutput.Type == TestOutputType.Out);
 }
示例#19
0
		/// <summary>
		/// A message has been output to the console.
		/// </summary>
		/// <param name="testOutput">A console message</param>
		public void TestOutput( TestOutput output )
		{
			events.Enqueue( new OutputEvent( output ) );
		}
		public void TestOutput (TestOutput testOutput)
		{
			// Console.WriteLine("TestOutput");
		}
示例#21
0
		public OutputEvent( TestOutput output )
		{
			this.output = output;
		}
示例#22
0
 public void TestOutput(TestOutput testOutput)
 {
     _log.Info("Test output: " + testOutput.ToString());
 }
示例#23
0
 public void TestOutput(TestOutput testOutput)
 {
     log(testOutput.Text);
 }
示例#24
0
 public void Write(NUnit.Core.TestOutput output)
 {
     Write(output.Text);
 }
		public void FireTestOutput( TestOutput testOutput )
		{
			Fire(
				TestOutput,
				new TestEventArgs( TestAction.TestOutput, testOutput ) );
		}
示例#26
0
 public OutputEvent(TestOutput output)
 {
     this.output = output;
 }
 /// <summary>
 /// Called when the test direts output to the console.
 /// </summary>
 /// <param name="testOutput">A console message</param>
 public void TestOutput(TestOutput testOutput)
 {
     if (this.eventListener != null)
     {
         this.eventListener.TestOutput(testOutput);
     }
 }
示例#28
0
 public void TestOutput(TestOutput testOutput)
 {
     _log(string.Format(testOutput.Text.Replace(Environment.NewLine, "")));
 }
示例#29
0
		// TestOutput
		public TestEventArgs( TestAction action, TestOutput testOutput )
		{
			Debug.Assert( action == TestAction.TestOutput,
				"Invalid TestAction argument to TestEventArgs constructor" );

			this.action = action;
			this.testOutput = testOutput;
		}
 public void TestOutput(TestOutput testOutput)
 {
     if (m_EventListener != null)
     {
         m_EventListener.TestOutput(testOutput);
     }
 }
示例#31
0
		/// <summary>
		/// Trigger event when output occurs during a test
		/// </summary>
		/// <param name="testOutput">The test output</param>
		public void TestOutput(TestOutput testOutput)
		{
			events.FireTestOutput( testOutput );
		}
 public void TestOutput(TestOutput testOutput)
 {
     this.listener.TestOutput(testOutput);
 }
示例#33
0
 public void TestOutput(TestOutput testOutput)
 {
 }
 public void TestOutput(TestOutput testOutput)
 {
     if (_outWriter.Value != null)
         _outWriter.Value.Write(testOutput.Text);
     else
         _wrapped.TestOutput(testOutput);
 }