So I'm writing a program that runs quite a few different tests. Which tests are ran varies based on which UI elements are selected by the user. For example, on one form I have 7 radio buttons and 6 check boxes. For each variation, anywhere from 2-5 different tests are ran. The user is able to select any combination (with the exception of only a single radio button) and run the tests for that selection. My method for determining which tests to run is very redundant and I was wondering if there was a more clean approach. Here is an example:
if(radiobutton1.checked)
{
if(checkbox1.checked)
{
runtest1(param a, param b);
runtest2(param b, param f);
}
if(checkbox2.checked)
{
runtest1(param f, param n);
runtest2(param c, param l);
runtest3(param f, param d);
}
}
else if(radiobutton2.checked)
//and so on...
So I have 42 use cases and I'm running 2-5 sub tests for each. Is there a better way to do this?