Exemplo n.º 1
0
        public void ValueListWithMaxElemOutsideBounds()
        {
            var  options = new OptionsWithValueListMaximumThree();
            bool result  = base.Parser.ParseArguments(
                new string[] { "file.a", "file.b", "file.c", "file.d" }, options);

            base.AssertParserFailure(result);
        }
Exemplo n.º 2
0
        public void Value_list_with_max_elem_outside_bounds()
        {
            var options = new OptionsWithValueListMaximumThree();
            var parser  = new CommandLine.Parser();
            var result  = parser.ParseArguments(
                new string[] { "file.a", "file.b", "file.c", "file.d" }, options);

            result.Should().BeFalse();
        }
Exemplo n.º 3
0
        public void ValueListWithMaxElemInsideBounds()
        {
            var  options = new OptionsWithValueListMaximumThree();
            bool result  = base.Parser.ParseArguments(new string[] { "file.a", "file.b", "file.c" }, options);

            base.AssertParserSuccess(result);
            Assert.AreEqual("file.a", options.InputFilenames[0]);
            Assert.AreEqual("file.b", options.InputFilenames[1]);
            Assert.AreEqual("file.c", options.InputFilenames[2]);
            Assert.IsNull(options.OutputFile);
            Assert.IsFalse(options.Overwrite);
            Console.WriteLine(options);
        }
Exemplo n.º 4
0
        public void Value_list_with_max_elem_inside_bounds()
        {
            var options = new OptionsWithValueListMaximumThree();
            var parser  = new CommandLine.Parser();
            var result  = parser.ParseArguments(new string[] { "file.a", "file.b", "file.c" }, options);

            result.Should().BeTrue();

            options.InputFilenames[0].Should().Be("file.a");
            options.InputFilenames[1].Should().Be("file.b");
            options.InputFilenames[2].Should().Be("file.c");
            options.OutputFile.Should().BeNull();
            options.Overwrite.Should().BeFalse();
            Console.WriteLine(options);
        }