Refactor TestValidateTemplate() into a table driven test