Optimize get route by name - Unit Tests Added.

Added Unit tests, fixed $idPrefix empty string condition. And added tests to cover condition.