How to get Console.WriteLine() working?
I posted the following question on stackoverflow: https://stackoverflow.com/questions/47272203/resharper-test-runner-not-outputting-console-writeline
I have a very simple goal: to see Console.WriteLine() statements in Resharper's Test Runner Output window.
In addition to the stackoverflow post; I tried the following: (please observe the Console Trace Listener)
[TestFixture]
internal class ObserverTestFixture
{
[SetUp]
public void Setup()
{
Trace.Listeners.Add(new ConsoleTraceListener());
}
[TearDown]
public void TearDown()
{
Trace.Flush();
}
[Test]
public void DemonstrateObserverPattern()
{
var subject = new Subject();
var a = new Observer(subject, "a");
var b = new Observer(subject, "b"); // etc. as many observers as you want.
subject.Go();
}
}
...which provided me PARTIAL success. This is what I see with the trace listener in the output window:
Subject: BEGIN
Observer a: BEGIN
Observer b: BEGIN
I'm baffled by this partial success...I thought it would display the entire output, just like how it appears in a console application. Again, see the stackoverflow post for full details (I don't want to repost here)
Help?
Why is this so difficult to write to the Output window in the test runner? How can I get it working?
Please sign in to leave a comment.