added tests for templateToArray