Revised unit test and implementation of GetCommandText