0

I'm writing a custom logger following this msdn blog and it's working I'm able to print in console the results of the test executions but now I need to improve this report and when I try to initialize an object or call a static method the logger fails.

for example:

 private void TestResultHandler(object sender, TestResultEventArgs e)
 {
 Console.WriteLine("TEST")
 Test test = new Test();

it prints in console -> TEST

but when I do this:

 private void TestResultHandler(object sender, TestResultEventArgs e)
 {
 Test test = new Test();
 Console.WriteLine("TEST")

or

 private void TestResultHandler(object sender, TestResultEventArgs e)
 {
 TestHandler.SaveData(e.Result.Duration);
 Console.WriteLine("TEST")

The console doesn't print anything.

Anyone knows why is this happening?

Thanks in advance, Ed

figuedmundo
  • 375
  • 1
  • 4
  • 15
  • wouldnt it be easier to exclude the initializing from the Handler? – Sebastian L Oct 14 '14 at 23:10
  • What the heck does constructing a Test object do? – Russ Oct 14 '14 at 23:49
  • Well, I try to initialize an object in order to save the information that the testResult is collecting like the duration of the testcase, the DisplayName, etc. and then use that object to serialize the information. – figuedmundo Oct 15 '14 at 00:01

0 Answers0