Hi,
For now I use the following solution:
I wanted to extend AutoRunner but as this class is 'sealed', I create a copy
of it DurationAutoRunner:
I modify the run method:
...
// run tests
double totalDuration = 0;
int successCount = 0;
int ignoreCount = 0;
int failureCount = 0;
double duration = 0;
while (totalDuration <= _duration)
{
timer.Start();
this.domain.TestEngine.RunPipes();
timer.Stop();
totalDuration += timer.Duration;
successCount +=
this.domain.TestEngine.Report.Result.Counter.SuccessCount;
ignoreCount += this.domain.TestEngine.Report.Result.Counter.IgnoreCount
;
failureCount +=
this.domain.TestEngine.Report.Result.Counter.FailureCount;
duration += this.domain.TestEngine.Report.Result.Counter.Duration;
}
// store result
this.result = this.domain.TestEngine.Report.Result;
this.result.Counter.SuccessCount = successCount;
this.result.Counter.IgnoreCount = ignoreCount;
this.result.Counter.FailureCount = failureCount;
this.result.Counter.Duration = duration;
...
Basically I execute the same test suite over and over, but sotre the results
(only the counters) to keep traces of it. It is working fine. There are
probably better solution, but I wanted to keep the results.
Ciao,
Richard.
On 7/18/07, Jeff Brown <[EMAIL PROTECTED]> wrote:
>
> Something similar is possible. You can create a new
> TestDecoratorAttribute that runs a test repeatedly for a set period of
> time. If any of the iterations fail, then the test should fail. In the
> report, this will appear as a single test result though...
>
> That's the best I can think of right now I'm afraid...
>
> Jeff.
>
> ------------------------------
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Richard Louapre
> *Sent:* Tuesday, July 17, 2007 7:04 AM
> *To:* [email protected]
> *Subject:* MbUnit Add a TestCase to TestSuite at runtime.
>
>
> Hi,
>
> I would like to execute the same TestCase for a time period. I'm not sure
> if it is possible.
>
> So I was looking for a way to add TestCase to a TestSuite at runtime.
>
> Is there a better way to achieve that?
>
> Thanks.
>
> Ciao,
> Richard.
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---