Added and improved CommandFactory unit test.