Thursday, May 07, 2009 9:45 PM
Sean Feldman
CategoryAttribute
Anyone who's doing TDD is familiar with the CategoryAttribute coming with the most of frameworks. Today (I am surprised it took us so long!) we got read of
[Category("Integration")]
and started to use the right approach
[Category(Categories.Integration)]
where Categories is a sealed class with constants
public sealed class Categories
{
public const string Integration = "Integration";
}
Why is it good? First - it's DRY (rather that finding strings such as "Integration" and "Integrations" all over the place. Second - it's easy to refactor.
Filed under: TDD