Esempio n. 1
0
        protected override void EstablishContext()
        {
            _consoleArguments = new List <string>
            {
                @"/Assembly:C:\\temp\test.txt",
            };

            _sut = new ArgumentMapFactory(() => _consoleArguments);
        }
Esempio n. 2
0
        protected override void EstablishContext()
        {
            _consoleArguments = new List <string>
            {
                @"/Assembly:'C:\\Documents and Settings\test.txt'",
            };

            _sut = new ArgumentMapFactory(() => _consoleArguments);
        }
Esempio n. 3
0
        protected override void EstablishContext()
        {
            _consoleArguments = new List <string>
            {
                "/Name:John",
                "/Name:Doe",
                "/Age:66"
            };

            _sut = new ArgumentMapFactory(() => _consoleArguments);
        }
Esempio n. 4
0
        public static Args ParseArgs(string[] args)
        {
            if (args == null) args = new string[0];
            if (args.Length == 0)
                _isDefault = true;

            var result = new Args();
            IArgumentMapFactory _argumentMapFactory = new ArgumentMapFactory();
            IArgumentParser _argumentParser = new ArgumentParser();
            IEnumerable<IArgument> arguments = _argumentParser.Parse(args);
            IArgumentMap mapper = _argumentMapFactory.CreateMap(result);
            IEnumerable<IArgument> remaining = mapper.ApplyTo(result, arguments);

            return result;
        }
Esempio n. 5
0
        public static Args ParseArgs(string[] args)
        {
            if (args == null)
            {
                args = new string[0];
            }
            if (args.Length == 0)
            {
                _isDefault = true;
            }


            var result = new Args();
            IArgumentMapFactory     _argumentMapFactory = new ArgumentMapFactory();
            IArgumentParser         _argumentParser     = new ArgumentParser();
            IEnumerable <IArgument> arguments           = _argumentParser.Parse(args);
            IArgumentMap            mapper    = _argumentMapFactory.CreateMap(result);
            IEnumerable <IArgument> remaining = mapper.ApplyTo(result, arguments);

            return(result);
        }