public void EmptyCommandLine() { CommandLineParseException exception = TestUtils.TestForError <CommandLineParseException>( () => new CommandLineTester().TestCommandLine(string.Empty), "Did not catch expected error."); Validate.Value.AreEqual(exception.Position, 0, "Error not found at correct index."); }
public void ParseDuplicateNamedArguments() { const string rawCommandLine = "hello -named1 value1 -named1 value2"; CommandLineParseException exception = TestUtils.TestForError <CommandLineParseException>( () => new CommandLineTester().TestCommandLine(rawCommandLine), "Did not catch expected error."); Validate.Value.AreEqual(exception.Position, 22, "Error not found at correct index."); }
public void CommandNameWithArgumentStartToken() { const string rawCommandLine = "-hello -argument"; CommandLineParseException exception = TestUtils.TestForError <CommandLineParseException>( () => new CommandLineTester().TestCommandLine(rawCommandLine), "Did not catch expected error."); Validate.Value.AreEqual(exception.Position, 0, "Error not found at correct index."); }
public void WhitespaceCommandLine() { const string rawCommandLine = " \t "; CommandLineParseException exception = TestUtils.TestForError <CommandLineParseException>( () => new CommandLineTester().TestCommandLine(rawCommandLine), "Did not catch expected error."); Validate.Value.AreEqual(exception.Position, 0, "Error not found at correct index."); }
public void NullArgumentName() { const string rawCommandLine = "hello - nextArgument"; CommandLineParseException exception = TestUtils.TestForError <CommandLineParseException>( () => new CommandLineTester().TestCommandLine(rawCommandLine), "Did not catch expected error."); Validate.Value.AreEqual(exception.Position, 7, "Error not found at correct index."); }