private Configuration ParseArguments() { var tokeniser = new Tokeniser(); var tokens = tokeniser.Tokenise(_args).ToList(); var parser = new GenerateCommandParser(); var configuration = parser.Parse(tokens); return(configuration); }
public void Should_Parse(string[] args, int messageCount, string[] messages) { var tokeniser = new Tokeniser(); var tokens = tokeniser.Tokenise(args.ToList()).ToList(); var parser = new GenerateCommandParser(); var configuration = parser.Parse(tokens); configuration.Messages.Count.Should().Be(messageCount); if (messageCount > 0) { for (int i = 0; i < messageCount; i++) { configuration.Messages[i].Message.Should().Be(messages[i]); } } }