Re: NUnit 2.5: What's In It Now

"Kelly Anderson" <[email protected]> Sun, 6 Apr 2008 22:56:10 -0600
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
On Sun, Apr 6, 2008 at 10:20 PM, Charlie Poole
<[email protected]> wrote:
>  I guess I'm not able to separate the /intention/ of the feature from
>  the implementation as easily as you are. Simply saying that it's
>  a different exception and the framework can do whatever it wants
>  with it begs the question of what you intend to be done with it.

I just want an exception that I can throw that means the Test exits
without penalty.

>  It seems to me that the natural meaning of Assume.That only
>  makes sense in the context of a Theory implementation where
>  the programmer does not directly control the inputs. If the
>  programmer controls the inputs, then Assume makes no sense
>  except as a different kind of error - you gave me bad data.

If the programmer is using a random number generator, or anything just
a little complex like reading data files that someone else may be
generating, then he loses total control over the input. That's part of
what you run into doing data testing.

>  > Would your implementation of Assume be different than that?
>
>  No - but what I do with the exception may differ.

That's why I asked for an extension point at that location in the
code... If I can do it another way, then that's fine too.

>  > Or, are you simply saying that you don't want to release
>  > Assume without also releasing Theory. Do they need to be tied
>  > together to be useful?
>
>  That's my view. And we aren't talking about years here, so
>  I don't see the sense of rushing into it.

Ok, I can deal with that.

>  > I guess I just don't understand if you didn't like the way I
>  > implemented Assume, or if you just have difficulty with doing
>  > it without some fuller approach to Theory first.
>
>  I think that it's a bad idea to implement Assume as an
>  independent feature. I'm not stopping you from implementing
>  it, since you do think it's a good idea, but you seem to
>  be trying to convince me to do it.

I wrote the code... it's not like the last time where I was trying to
get you to do it. All you have to do is accept my contribution. :-)

>  > I'm not trying to be confrontational, I just really don't
>  > understand the sense in which you are objecting to putting
>  > Assume in earlier rather than later...
>
>  Separately rather than "as a part of" would be my terms.

Ok, I just think it's useful separately. We obviously have a
difference of opinion, and that makes the world go round. Where I have
difficulty is that it "feels" like an emotional response rather than a
technical one. That is probably a limitation of the medium more than
anything else, but I just can't grok your technical argument because
it seems to be based on "I haven't thought about it enough yet" and
not much more. I'm done beating this dead horse. I'm sure we'll get it
right in 3.0, or perhaps close to right in an Addin.

>  > Consider this use case of a data test  (which is real, I did
>  > it Thursday)... I want to iterate over all the files in a
>  > directory, and validate things about the files if they are
>  > the right type and version. I could do this with your
>  > proposed 2.5 like this:
>
>  <snipped long example/>
>
>  Your example works fine without Assume - just substitute
>  "if" for "Assume.That"

With that argument, then there is no need for Assume even with a full
blown 3.0 Theory implementation. Unless it's just a semantic issue. My
lack of emotion about BDD should be a clue how I feel about that sort
of argument :-)

>  > >  2) As I mentionned in the earlier note, it's not hard  for
>  > someone to
>  > > implement Theory as an extension using  the existing
>  > extension points.
>  > > Gary has done that, in fact.
>  >
>  > I'm not really talking about Theory, I'm talking about
>  > Assume. It's great what Gary has done, but without Assume,
>  > it's only half the story.
>
>  So modify it. Or write your own. Or write something else
>  that incorporates Assume. It will need some kind of test that
>  interprets the exception - just as only NUnitTestMethods
>  know what an AssertionException means.

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.

>  > >  I don't want to discourage you - not even, :-) - from  doing stuff
>  > > either. In fact I encourage it. Have you  tried out Gary's Theory
>  > > extension? Does it work for you?
>  > >  Does it need something? Can you contribute whatever  that is? ...
>  > > See, I'm encouraging you. :-)
>  >
>  > I have not yet tried Gary's extension, but I intend to do so
>  > as soon as I have a chance. Things have been a bit busy lately.
>
>  Well that's one thing we have in common. :-)

I'll see if I can fit it in this week...

-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