Re: NUnit 2.5: What's In It Now

"Charlie Poole" <[email protected]> Sun, 6 Apr 2008 18:01:50 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <001201c8984a$f6f93c30$6401a8c0@ferrari>
Hi Kelly, 

Knowing your mail habits, I'm sending this back to the list. :-)

> Let us know when the snapshot is ready. I'm CVS challenged 
> and short on time. :-(

OK.
 
> >  Both the Gui and the console now display more detailed  
> summary info: 
> > errors, failures, not runnable, ignored  and skipped tests. While 
> > not-runnable (invalid) tests  are not counted as errors, 
> they display 
> > in red in the  gui anyway so that they will get your attention.
> 
> If I were to implement an addin or something to do my 
> approach to Theory, which of these would you recommend for 
> the result of running a  Theory and having Assume bail out of 
> the run? Do any of them make sense?

I see two possible choices, neither of which is currently
available:

1) Inconclusive, which has been requested as a feature.
It makes sense that "Inconclusive" could be OK in a
Theory situation - provided other data is supplied - but
not OK in a normal Test.

2) No result at all, with the Theory giving only one result
if it passes and reporting specific failures if it fails.
This is how I tend to think of it. It means that two
implementations, one of them filtering the data 
externally and one internally will give the same results.

> >  Test methods may have arguments (if you provide them)  and return 
> > values. There are two new attributes for  specifying test data: 
> > TestCase and DataSource.
> 
> Have you described DataSource anywhere besides this email? I 
> can guess how it works from what you say below. I have 
> noticed that the documentation page is lagging the current 
> release, is there some way I could help out with that? Just 
> let me know what you want documented, or I can point out what 
> I think is missing.

It's in the docs, which will be part of the snapshot. Finishing
them up is actually what is keeping me from releasing right now.

> >  TestCase provides inline arguments and may also specify  
> an expected 
> > exception, expected return value, test name  and description.
> 
> Way cool.
> 
> >  DataSource may take a string or a Type. A string is  the name of a 
> > static property returning an IEnumerable.
> >  A Type must contain such a property - the first one  found is used.
> 
> Interesting approach to DataSource. Still doesn't give a 
> compile time error. If the type had to implement the 
> IEnumerable interface instead of just having an IEnumerable 
> property, then could you have a compile time error reported?

I agree. Of course, we would have to actually instantiate
the object in that case. I'll see about adding this in 
the next drop.

> >  In either case, the IEnumerable should return either  an 
> object array 
> > - if only args are provided - or  an object with properties 
> similar to 
> > those of the  TestCase attribute. This allows the provider 
> to  supply 
> > a return value, expected exception, etc.
> >
> >  TestCase and DataSource may be mixed on a method.
> 
> This sounds like a case for a little bit of documentation.  
> Give me a simple sample, and I can probably run from there.

See http://nunit.org/?p=testCase&r=2.5 and
http://nunit.org/?p=dataSource&r=2.5

Note that these pages have been updated, but others not yet.
 
> >  A new extension point "ParameterProviders" is available  
> for addins 
> > that provide test case data to paramterized  methods.
> 
> I would kill to have a new extension point that would allow 
> me to put an intercept in that would allow me to do Assume... 
> It would be really simple, I think.

There is one: since Tests handle their own exceptions, you 
just need to create a test type that handles this. You might
call it "Theory" :-)

> >  I think we are at a point where a preliminary  release of 
> some kind 
> > is called for. After that...
> >
> >  WHAT REMAINS TO DO
> >
> >  I'm looking at Gary's Theory extension to see if it  fits 
> into this 
> > timeframe.
> 
> I know that Assume is off your list for 2.5. But would it be 
> possible to implement a couple of minor extension points that 
> would allow for it in an Addin? It doesn't seem like that 
> would be too hard, or take away very much from what Theory 
> might develop into in the future.

Answering this separately.

Charlie

> -Kelly
> 




-------------------------------------------------------------------------
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