简体   繁体   中英

Can ReSharper's test runner be configure not to show Debug.WriteLine() messages?

I want to omit Debug.Write/WriteLine messages from ReSharper's test runner output. Is it doable?

while (Debug.Listeners.Count > 0) Debug.Listeners.RemoveAt(0);

or more targeted (for NUnit test framework):

var nunitListener = Debug.Listeners.Cast<TraceListener>().Where(tl => tl.Name == "NUnit").FirstOrDefault();
if (nunitListener != null) Debug.Listeners.Remove(nunitListener);

Notice that though ReSharper adds its own trace listener, it is NUnit's trace listener that Test Runner shows in the output. I do not know why, but removing "NUnit" trace listener does the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM