Recent 2.5 Changes

"Charlie Poole" <[email protected]> Mon, 28 Jul 2008 13:20:04 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <000d01c8f0ef$526f3950$6401a8c0@ferrari>
Hi All,

As usual, this is for those who track the CVS source. The
rest will have to wait for alpha-4, but it shouldn't be
too long...

1. Classes can have multiple setup, teardown, fixture setup
or fixture teardown methods. Base setups are run before
the derived setup and teardowns are run in reverse. Within
the same class declaration, order is undefined, so it's not
too useful but still possible.

NOTE: If you /override/ a base class method, you don't have
two methods any more, so only the override runs. Do that
if that's what you want, otherwise don't. :-)

2. DataSourceAttribute provides a way to point to data
for individual arguments just as FactoriesAttribute (I
still don't like that name) points to entire test cases.

3. TestFixtures can now have parameters, which are used
in searching for a constructor. You repeat [TestFixture(...)]
just as you do for [TestCase(...)] and each individualized
fixture is created separately in the tree.

4. We already had generic fixtures and now they can have
parameters too. You can specify what types to use in 
creating a specific class from the generic declaration
in three ways...

 1) By preceding the constructor args with a set of 
    Types to be used. This won't work if the first
    constructor arg is a Type, of course.

 2) By using the TypeArgs named property of TestFixtureAttribute

 3) By using a constructor that makes use of all the 
    Type parameters - in that case NUnit will figure
    it out.

I'm aware that the last bit particuarly needs documentation.
Consider the above as hints for the brave among you.

Charlie





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/