public void TraceAllWithNewType() { const string newType = "__NEW_TYPE__"; var listener = new TestListener(); var advListener = new TestAdvancedTraceListener(); AdvancedTrace.AddTraceListener(AdvancedTrace.ListenerType.All, listener); AdvancedTrace.AddTraceListener(AdvancedTrace.ListenerType.All, advListener); AdvancedTrace.AddTraceType(newType); AdvancedTrace.TraceInformation("Default information"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceInformation("Information with exception", new FileNotFoundException("file.ext")); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceInformation("Information on a category", "Category2"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceInformation("Information with exception on a category", new Exception("Base exception"), "Category1"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceDatabase("Database"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceError("Error"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceFatal("Fatal"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceDebug("Debug"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceSQL("SQL"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceProblem("Problem"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceWarning("Warning"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.Trace(newType, "New type"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); AdvancedTrace.TraceInformation("Finish"); Assert.True(listener.IsNewMessage()); Assert.True(advListener.IsNewMessage()); }