Re: Is.NullOrEmpty

Cory Foy <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Charlie Poole wrote:
> It's a minor new feature. I thought of doing it but didn't. My reasoning is
> that
> with a well-written interface, you should be able to predict whether
> something
> is null or empty.
>  
> Currently, you can write Assert.That(firstname, Is.Null | Is.Empty );
>  
> If you want the feature, put in a request with some explanation of the
> situation
> in which you don't actually know what to expect. That way it may get a
> higher priority.

FWIW, I think IsNullOrEmpty would be useful. In the short term, if you 
like the above syntax and are using .NET 3.0, you could probably use 
extension methods to add an IsNullOrEmpty to Is. I'm just theorizing 
here and haven't tried that.

-- 
Cory Foy
http://www.cornetdesign.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.