Re: Status of Data Driven tests

"Charlie Poole" <[email protected]> Tue, 25 Mar 2008 17:54:05 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <018f01c88edb$e6d91eb0$6401a8c0@ferrari>
Hi Andreas, 

> > I haven't yet implemented ExpectedException, TestName or 
> Description, 
> > but they seem straightforward enough.
> > Do we need/want all these?
> >   
> Well, TestName was actually a feature request from a user of 
> the RowTest extension. I think that ExpectedException makes 
> sense. Without it, it's hard to verify that invalid input 
> specified in the TestCase attribute should cause an exception 
> to be thrown.

I figured we needed ExpectedException but I was't sure about
the other two. I can see how TestName might be needed in a
case where the argument types didn't give a nice name and
Description is easy enough to do.

> > I'll add use of a property or method to return argument 
> lists in the 
> > fashion of IterativeTest.
> >
> > I'm considering allowing methods with return values, with the test 
> > cases specifying the expected value and NUnit doing an automatic 
> > assertion on equality.
> >
> > [TestCase(2, 2, Expect=4)]
> > [TestCase(10, 1, Expect=11)]
> > [TestCase(2, -2, Expect=0)]
> > public int TestMethod()
> > {
> >     return MyAddMethod(a, b);
> > }
> >
> > This would allow something very close to testing the 
> production code 
> > directly. Does it look like it might be useful?
> >   
> Nice idea. It makes the expected result distinguishable from 
> the input.

I think I'll go for it.

As I work on this, I realize that there is a distinction to
be made between this sort of TestCase or Row specification
and simple data sources. In the latter, you can only provide
data and these extra properties don't make sense. That may
mean that there are two Extensibility interfaces involved
and that's what I'm working on right now.

Further news: I've implemented ten priority levels for
test decorators and have tests to ensure that they apply
themselves in that order - 0 through 9. What I now need
is some sort or naming convention for the priorities
together with some guidance of how to use them.

Charlie

> 
> Andreas
> 
> 




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace