move TestMethod class to own file
regenerate-test, write only if content changed

Shouldn't write to file when it hasn't changed at all.
Use test function provided by template

Templates may change the function name prefix, so get function name by
rendered template