ToXml() public method

Convert the TestOutput object to an XML string
public ToXml ( ) : string
return string
Exemplo n.º 1
0
        /// <summary>
        /// Called when the test creates text output.
        /// </summary>
        /// <param name="testOutput">A console message</param>
        public void TestOutput(TestOutput testOutput)
        {
            try
            {			
#if false
				string report = string.Format("<output type=\"{0}\"><text>{1}</text></output>",
				    testOutput.Type, testOutput.Text);

				handler.RaiseCallbackEvent(report);
#else
                handler.RaiseCallbackEvent(testOutput.ToXml(false).OuterXml);
#endif
            }
            catch (Exception ex)
            {
                log.Error("Exception processing: " + testOutput.ToString() + NUnit.Env.NewLine + ex.ToString());
            }

        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when a test produces output for immediate display
 /// </summary>
 /// <param name="output">A TestOutput object containing the text to display</param>
 public void TestOutput(TestOutput output)
 {
     try
     {
         handler.RaiseCallbackEvent(output.ToXml());
     }
     catch (Exception ex)
     {
         log.Error("Exception processing TestOutput event" + NUnit.Env.NewLine + ex.ToString());
     }
 }