Re: Key word suggestions?

"Olof Bjarnason" <[email protected]> Mon, 8 Sep 2008 22:56:42 +0200
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
2008/9/8 Charlie Poole <[email protected]>:
> Hi Olof
>
>> Reading it aloud:
>>
>> 'Assert that myCollection is ordered by "Key" using comparer
>> myComparer'
>>
>> If forced to choose one for both scenarios my choice would be
>> "UsingComparer", even though it is not on your original list :)
>
> Yes it was. You missed this one...
>
>> >      etc.

Heh. :)

Which case is more common (I know that may be a hard question to answer!):

 Assert.That( data, Is.EqualTo(expected).Using(myComparer);

.. or

 Assert.That( data, Is.EqualTo(expected).Using(delegate(MyClass a,
MyClass b) { return a.Name.CompareTo(b.Name); });

?

The latter may well become (if not already!) the more common with the
shorter syntax of .NET3.5: (or is it 3.0..? Don't you just hate it
when big versions come so close they are hard to distinguish..?):

Assert.That( data, Is.EqualTo(expected).Using( (a,b) =>
a.Name.CompareTo(b.Name) );

What I mean is that choosing the short name "Using" might be a little
too brief without the added readability of the variable name
"myComparer", given the most ubiqous use case (?) of an anonymous
IComparer ...

>
> Charlie :-)
>
>
>
>

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