Re: NUnit 2.5: What's In It Now

"Charlie Poole" <[email protected]> Tue, 8 Apr 2008 09:08:56 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <000101c89992$dcc0d8c0$6401a8c0@ferrari>
Hi Kelly, 

> > I did write it. I guess I integrated it too tightly into the core 
> > though. Perhaps I should take it up with Gary and see if he can 
> > incorporate my Assume into his Theory... if he hasn't done 
> something similar already.
> 
> As I said, I may have missed something here. I knew you had 
> written some code, but I thought it was only on-the-job and 
> not available for us to see. If you let me know (again?) 
> where it is, I'll take a look and maybe that will clarify things.

Ah sorry, now I realize what you are talking about.

You did't do an extension, but a complete change to the NUnit
codebase. We even had some discussion around the best way
to send patches.

I wasn't relating it to this discussion, because
1) I got it on the nunitv3 list
2) It was a change to NUnit itself, not an extension
3) It was late and I wasn't making connections

Or all of the above - take yer cherce. :-)

Anyway, yes, this is indeed "too tightly integrated" since
it modifies some basic stuff in NUnit. More exactly, you
modified another extension - the one that does NUnitTestMethods.

I have been finding this a hard concept to get across: NUnit's
own tests are extensions themselves, and are not intended to
be the only kind of extensions that run on NUnit. That's a
bit hard to see when most current extensions inherit from
NUnit's internal extensions, but that wasn't how it was
supposed to work.

In particular the class NUnitFramework is supposed to hold
the basic behavior of /NUnit/ tests - not of all tests. You'll
see that my csUnit extension has a similar class that holds
it's different behavior. In fact so does your IterativeTestExtension.

So the part you are changing - where you have asked for new
extension points to be added - /is/ an extension. It's not
a place for extension points until we have the ability for
extensions themselves to have extension points - in 3.0.

As Gary has discussed, it would be trivial to put the same
code you wrote into a special test type, where it would
work exactly as it works in the code you sent. Then you
would be sending me a 20K extension rather than 2M of
NUnit source code!

If your feature is intended to be a kind of NUnit test
then you should probably derive the test from NUnitTestMethod,
although that will expose you to future changes in
NUnitTestMethod. It may be better to inherit from TestMethod
or ParameterizedTestMethod - which doesn't yet exist, but
which I'm thinking of facoring out.

Similarly, your builder could inherit from NUnitTestCaseBuilder
if you want to get all its behavior, now and in the future.

Sorry for the confusion - I thought we were talking about
something entirely different.

Charlie



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone