I’m Lazy And I Need My Helpers

public static class NumericExtensions
{
public static bool IsZero(this byte number)
{
return 0==number;
}
public static bool IsZero(this short number)
{
return 0==number;
}
public static bool IsZero(this int number)
{
return 0==number;
}
public static bool IsZero(this long number)
{
return 0==number;
}
public static bool IsZero(this float number)
{
return 0==number;
}
public static bool IsZero(this double number)
{
return 0==number;
}
public static bool IsZero(this decimal number)
{
return 0==number;
}
}

I wanted something like this today as I was toggling between NUnit and MSTest. Sure, Assert.That( something, Is(0) ) is readable, but its not portable. Its NUnit only, and for this project, I can’t do that. I also like the english reading of IsZero() vs. Is(0)

I think I’ve stated before that any code on this blog (c) by me and licensed under the MIT/X11 License, but for certain bits of code, I see no point in that. So I’m going to start tagging code with CC0, Unlicense and/or WTFPL.