Add Category parameter to TestCaseSourceAttribute

Bug #785460 reported by Charlie Poole
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NUnit Framework
Fix Released
High
Charlie Poole
NUnit V2
Fix Released
Medium
Charlie Poole

Bug Description

By email from Oleg Gerovich:

I am unable to enter bugs on Launchpad, so I'm emailing you per your request.

We need the following feature (came out of discussion of bug 691129).

Add Category parameter in TestCaseSource. Example:

[TestCaseSource("dataList1", Category="Dev")]
[TestCaseSource("dataList2", Category="Production"]

NUnit should execute all tests in dataList1 if Dev category was accepted and all tests in dataList2 if Production category is accepted. That should be the default behavior. You can also add an option like "CategorySource", which can be set to "TestCaseSource" to result in default behavior or to "TestCaseData" to run tests in dataList1/2 that have category Dev/Production (this is your approach #1 in bug 691129). We are interested in the default behavior right now, so if adding the option is troublesome, it's not a big deal. Option names/values are up to you.

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

Rather than add an option to make "Category" mean two quite different things, I would be inclined to use an entirely different property if we needed the alternate approach in the future.Thinking about it, I have concluded that what you are asking for seems to be closest to the normal meaning of Category, i.e. it applies directly to whatever it is placed on. We'll worry about the other approach if someone actually needs it in the future.

Revision history for this message
Oleg Gerovich (oleg-gerovich) wrote :

That sounds good. Thanks.

Changed in nunitv2:
status: New → Triaged
importance: Undecided → Medium
Changed in nunitv2:
milestone: none → 2.6.0
Changed in nunitv2:
assignee: nobody → Charlie Poole (charlie.poole)
status: Triaged → In Progress
Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Charlie Poole (charlie.poole)
Changed in nunitv2:
status: In Progress → Fix Committed
Changed in nunit-3.0:
milestone: none → 2.9.6
Changed in nunitv2:
status: Fix Committed → Fix Released
Changed in nunit-3.0:
status: Triaged → Fix Committed
Changed in nunit-3.0:
status: Fix Committed → Fix Released
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.