Fixed onCommand() mock and added two tests