public void AlternateSyntax() { var args = new AlternateSyntaxArguments(); var reader = CreateReaderThatReturns(new[] { "/value:abc" }); var options = new CommandLineParserOptions { FileSystemReader = reader }; TryParse(new[] { "@foo" }, args, options).Should().BeFalse(); reader.DidNotReceive().GetLines("foo"); TryParse(new[] { "#!foo" }, args, options).Should().BeTrue(); reader.Received().GetLines("foo"); args.Value.Should().Be("abc"); }
public void AlternateSyntax() { var args = new AlternateSyntaxArguments(); var reader = CreateReaderThatReturns(new[] { "/value:abc" }); var options = new CommandLineParserOptions { FileSystemReader = reader }; CommandLineParser.Parse(new[] { "@foo" }, args, options).Should().BeFalse(); reader.DidNotReceive().GetLines("foo"); CommandLineParser.Parse(new[] { "#!foo" }, args, options).Should().BeTrue(); reader.Received().GetLines("foo"); args.Value.Should().Be("abc"); }