petabridge/NBench

TestFixtureSource not supported

KthProg opened this issue · 2 comments

The runner should allow NUnit to set up tests as normal, and then proceed to add timing functionality on top of this. When using a TestFixtureSource, I simply get an error about no parameterless constructor, when of course this is by design, and my tests can't run if the test fixture was created using a parameterless constructor.

Is this issue for NBench or NUnit? We don't have any kind of fixture support yet (although I'd really like to add it!)

NUnit supports a TestFixtureSource attribute, that creates an instance of the test class for each object you return as a source. The problem is, NBench expects an empty constructor, and instantiates the fixture from this. Hence, I can't use my test fixture with a test fixture source with NBench. Why not write NBench as a test adapter like NUnit3? And then build on top of the NUnit functionality? That way it would be consistent with all of their attributes, which can get pretty crazy and wildly complicate the actual number of tests.