Khanh Nguyen
Khanh Nguyen

Reputation: 75

NUNIT with more helpful log

I have a lot of unit tests in c#. Now I want nunit to log the following when it runs: - Time when a test starts/Finish. - Result of the test. - Name of the test.

For example:

[2/10/2014 16:11:00] TestA STARTED
[2/10/2014 16:12:00] TestA OK
[2/10/2014 16:13:00] TestB STARTED
[2/10/2014 16:14:00] TestB FAILED: exception.

I don't want to go to every single test to make it happen because I have a lot of unit tests over the years. Is there any way that you know of can make it easy for me to do so?

Really appreciate your help.

Upvotes: 1

Views: 147

Answers (1)

McAden
McAden

Reputation: 13972

I started writing an answer advising you to use Setup and Teardown but got to thinking you'd have issues trying to display the result. Turns out you'll have to use an NUnit EventListener

@Izzy posted some example code in his similar question here

Upvotes: 1

Related Questions