Re: NUnit 2.5: What's In It Now
"Kelly Anderson" <[email protected]> Sun, 6 Apr 2008 19:53:30 -0600
| Newsgroups | gmane.comp.windows.dotnet.nunit.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Apr 6, 2008 at 7:01 PM, Charlie Poole <[email protected]> wrote: > Hi Kelly, > > Knowing your mail habits, I'm sending this back to the list. :-) Uh, good call.. :-) > > > 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. Ok. That's one possibility. Sounds good. > 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. There's also the case where none of the data passed in gets past the Assumes. That's supposed to be a failure, but I suppose that is already covered by fail. > > > 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. Well, since you can't use the DataSource for more than one thing anyway, this seems like a cleaner approach. > > 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. That helps a lot. > > > 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" :-) We'll have to discuss this further. :-) Perhaps we can start a new thread for this? > > > 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. Ok. By the way, I have run into several instances recently where I found Assume would have been useful and appropriate inside of regular data driven tests. -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