Instead of implementing this manually, you canThere is no need to reinvent the wheel - use the functionality of your favorite unit testing framework. For example, Nunit provides a "combinatorial" attribute (and some other helpful attributes like "sequential") which does exactly what you are looking for. For JUnit, you find add-ons like "jcombinatorial". I guess there are similar functionalities for other xUnit frameworks.