Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NUnit Repeat Attribute
mikeedwards83
#1 Posted : Monday, January 14, 2013 7:23:31 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2011(UTC)
Posts: 8

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?
Remco
#2 Posted : Monday, January 14, 2013 10:40:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
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.
mikeedwards83
#3 Posted : Monday, January 14, 2013 10:51:25 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2011(UTC)
Posts: 8

Thanks for the reply, I have implement the stopwatch solution.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download