Generalized the test framework