Combination of Repeat attribute and TestCase attribute not working.

Bug #917590 reported by Anuraj
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NUnit Framework
New
Undecided
Unassigned

Bug Description

Today I got some intermittent failures in my regression tests, so for reproducing the bug I added a Repeat attribute with Testcase attribute. Like this

[Repeat(10)]
[TestCase(Mode.WCF, Execution.Remote, Description = "OutProc Test")]

//Both Mode and Execution is enums

But the Test executed only once.

I am not sure it is reported before, but I couldn't find it in the buglist.

Revision history for this message
Anuraj (anuraj-p) wrote :

Sorry I forgot to mention the Environment.

I am using NUnit 2.6, OS Windows 7 64Bit. .Net 4.0

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Repeat currently only works on individual tests, not on suites. The [Repeat(10)] attribute in your example applies to the test method, not the individual test case. The method represents a suite and so it is ignored. There is currently no way to apply a Repeat count to a test case. That would require adding a named property to TestCaseAttribute.

Admittedly, this case is quite confusing. We'll improve the documentation for 2.6 - it's currently only one line for Repeat - and plan on implementing a more general Repeat capability in 3.0.

affects: nunitv2 → nunit-3.0
tags: added: feature framework
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.