while looking at Shrinkr's source code (we all review other project's source code to learn, right??? :) ) I noticed the following kewl code .. (abbreviated by me, below)
public virtual Foo Foo
{
get;
set
{
Check.Argument.IsNotNull(value, "value");
// then do something.
}
}
Notice the fluent way they check for arguments? Nice :)
(source: cherrythian.com)
So .. checking the code, they have some custom class that does this...
public static class Check
{
public static class Argument
{
public static void IsNotNull(object parameter,
string parameterName)
{ ... }
public static void IsNotNullOrEmpty(string parameter,
string parameterName)
{ ... }
.... etc ....
}
Are there any common frameworks out there?
gem install netFluentCheck ?
:)