public void AvroTools_RunHelpWithNoArgument()
 {
     var actualExitCode = Execute(new[] { "Help" });
     var expectedMessage = new HelpCommand().GetCommandsList();
     Assert.AreEqual(expectedMessage, MockExecutionContext.OutMessage);
     Assert.AreEqual(ExitCode.Success, actualExitCode);
     Assert.IsNull(MockExecutionContext.ErrorMessage);
 }
 public void AvroTools_RunWithWrongArgument()
 {
     var actualExitCode = Execute(new[] { Utilities.GetRandom<string>(false) });
     var expectedMessage = new HelpCommand().GetCommandsList();
     Assert.AreEqual(ExitCode.InvalidArguments, actualExitCode);
     Assert.AreEqual(Resources.InvalidArgsErrorMessage, MockExecutionContext.ErrorMessage);
     Assert.AreEqual(expectedMessage, MockExecutionContext.OutMessage);
 }
        public void AvroTools_RunWithNoArguments()
        {
            using (var stringReader = new StringReader(string.Empty))
            {
                Console.SetIn(stringReader);

                var actualExitCode = Execute(new string[] { });
                Assert.AreEqual(ExitCode.InvalidArguments, actualExitCode);
            }
            var expectedMessage = new HelpCommand().GetCommandsList();
            Assert.AreEqual(Resources.InvalidArgsErrorMessage, MockExecutionContext.ErrorMessage);
            Assert.AreEqual(expectedMessage, MockExecutionContext.OutMessage);
        }
 public void AvroTools_RunHelpWithEmptyArgument()
 {
     var actualExitCode = Execute(new[] { "Help", HelpCommand.CommandPrefix });
     var expectedMessage = new HelpCommand().GetCommandsList();
     Assert.AreEqual(expectedMessage, MockExecutionContext.OutMessage);
     Assert.AreEqual(ExitCode.InvalidArguments, actualExitCode);
     Assert.AreEqual(Resources.InvalidArgsErrorMessage, MockExecutionContext.ErrorMessage);
 }
 public void AvroTools_RunHelpWithTooManyArguments()
 {
     var actualExitCode = Execute(new[] { "Help" }.Concat(Utilities.GetRandom<string[]>(false)).ToArray());
     var expectedMessage = new HelpCommand().GetCommandsList();
     Assert.AreEqual(expectedMessage, MockExecutionContext.OutMessage);
     Assert.AreEqual(ExitCode.InvalidArguments, actualExitCode);
     Assert.AreEqual(Resources.InvalidArgsErrorMessage, MockExecutionContext.ErrorMessage);
 }