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()); } }
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()); } }