Exemplo n.º 1
0
 public void Standard()
 {
     using (StringWriter writer = new StringWriter())
     {
         using (TextWriterTraceListener listener = new TextWriterTraceListener(writer))
         {
             Debug.Listeners.Add(listener);
             DebugStream output = new DebugStream();
             output.Standard("this is a standard message");
         }
         Assert.AreEqual("this is a standard message", writer.ToString().Trim());
     }
 }
Exemplo n.º 2
0
 public void Error()
 {
     using (StringWriter writer = new StringWriter())
     {
         using (TextWriterTraceListener listener = new TextWriterTraceListener(writer))
         {
             Debug.Listeners.Add(listener);
             DebugStream output = new DebugStream();
             output.Error("this is an error");
         }
         Assert.AreEqual("ERROR:this is an error", writer.ToString().Trim());
     }
 }