Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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");
        }