Ejemplo n.º 1
0
        public void Parse_SimpleStringNoRequiredValueNotSupplied_ReturnsNull()
        {
            var args = new string[0];
            var opt  = new SimpleStringOptions();

            var p = new CommandLineParser();

            p.Parse(opt, args);

            Assert.Null(opt.Hello);
        }
Ejemplo n.º 2
0
        public void Parse_SimpleStringNoRequiredValueSupplied_ReturnsValueFromCommandLine()
        {
            var args = new[] { "--hello", "sampleval" };
            var opt  = new SimpleStringOptions();

            var p = new CommandLineParser();

            p.Parse(opt, args);

            Assert.Equal("sampleval", opt.Hello);
        }
Ejemplo n.º 3
0
        public void Parse_Position_ValidResult()
        {
            var args = new[] { "sampleval", "sampleval2" };
            var opt  = new SimpleStringOptions();

            var p = new CommandLineParser();

            p.Parse(opt, args);

            Assert.Equal("sampleval", opt.Hello);
            Assert.Equal("sampleval2", opt.HelloSecond);
        }