Re: RFC: PropertyConstraint breaking change

"Charlie Poole" <[email protected]> Wed, 3 Sep 2008 20:53:00 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <004f01c90e41$bbeaa530$6401a8c0@ferrari>
Hi Cory, 

> Charlie Poole wrote:
> > I plan to remove the following syntactic examples
> > 
> >   Has.Property("X", value)
> >   Has.Length(value)
> >   Has.Count(value)
> > 
> > The new syntax is
> > 
> >   Has.Property("x").EqualTo(value)
> >   Has.Length.EqualTo(value)
> >   Has.Count.EqualTo(value)
> 
> And sadly we can't mark the former as deprecated because 
> there would be a namespace collision. 

You got it! :-)

> I guess we could if we 
> were willing to do:
> 
> Has.Length().EqualTo(value)
> 
> And then next release go to the proposed syntax.

I hadn't thought of staging it like that. Of course, 
it means everyone would have to edit their tests twice.

> But I say that if no one has any objections, the latter seems 
> clearer to me.

That's my thought... unless some folks say "We use that in
a jazillion places and we can't change it because... "

I'm trying to get rid of F(void) as a pattern in the syntax
entirely. It's confusing if you're trying to look at it as
a DSL. In some cases, I can use two different words - for
example, Is.Ordered and Is.OrderedBy(...) but in this
case I can't make that work.

BTW, Property is one of two places where the syntax
is context-sensitive so there's a bit of unavoidable
messiness that my precedence matrix can't handle.
That's because you can write both
 Has.Property(name)
and
 Has.Property(name).EqualTo(xxx)
so I really like any simplification can.

The other place? Throws.Exception. :-)

Charlie

> 
> --
> Cory Foy
> http://www.cornetdesign.com
> http://www.agileflorida.com
> 
> 
> --------------------------------------------------------------
> -----------
> This SF.Net email is sponsored by the Moblin Your Move 
> Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & 
> win great prizes
> Grand prize is a trip for two to an Open Source event 
> anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> nunit-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-developer
> 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/