Daily Usage Issues

NUnit Repeat Attribute

Started by mikeedwards83 on 7,648 views

I am using the RepeatAttribute from NUnit on a test, NCrunch gives me the execution time for the total time for all repeats to have executed. Is it possible to set it so that it shows me the time for an individual test i.e. total/repeats?
Unfortunately not. The RepeatAttribute and its behaviour are fully under the control of NUnit, which creates an artificial loop around the test code and reports the entire repeated process as a single test call.

I would recommend implementing the repeated logic manually using a for loop, and recording the execution times using a StopWatch and dumping them to the console. When you click on the test, you'll then see the individual execution times for each loop as they were written by your code.
Thanks for the reply, I have implement the stopwatch solution.

Post a reply

Log in to reply.