Improved unit test framework to avoid multiple evaluations