Data Driven TestFixture

Bug #505700 reported by winner on 2010-01-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework

Bug Description

[Bug now tracked at]

I have hierarchy like data-driven test cases that’s 3 levels deep.
Currently the TestFixture can only be instantiated only a constant
number of times. How can I parameterize the TestFixture based on
source input, same like the TestCaseSource attribute?


Here is simple example, I need the NUnit GUI to be something like this.

     Rectagle("length1", "width1")
     Rectagle("length2", "width2")

The Rectangle and CircleInsideTheRectangle TestFixture class can be any number (it's data driven). The MaxSquareOutsideCircleAndInsideRectangleTest is a data driven test method.

While sure everything can be made into TestCaseSource, for complex test the data input will be very long.

For efficiency, I would like the TestFixture class to be instantiated only once for all the child TestFixture and TestCase. Because the setting up and tearing down could take a long time. As seen the child require some information from the parent. This may need abstract class and inheritance, but it's not easy to do.

Thank you very much.

Best regards,

winner (edward-yap) on 2010-01-11
description: updated
winner (edward-yap) on 2010-01-11
description: updated
Charlie Poole (charlie.poole) wrote :

We need the equivalent of TestCaseSource for parameterized fixtures. Not sure about the nesting right away - that may be a further addition at a later time.

Changed in nunit-3.0:
importance: Undecided → High
status: New → Triaged
tags: added: framework
description: updated
tags: added: github
removed: feature framework
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers