Ejemplo n.º 1
0
        public void AddRange_Customer()
        {
            CustomerModel      model      = new CustomerModel();
            CustomerCollection collection = new CustomerCollection();

            CustomerModel[] list = { model, model };
            collection.AddRange(list);

            Assert.Equal(2, collection.Count);
        }
        public static IEnumerable <CustomerModel> Execute(string[] args)
        {
            ConsoleInput input = new ConsoleInput();

            ParseFilePath(args[0], ref input);
            IEnumerable <string> lines = null;

            if (input.FilePath != null)
            {
                lines = File.ReadLines(input.FilePath);
                ParseDelimiter(args[1], ref input);
                ParseCommand(args[2], ref input);
                ParseCommandOption(args[3], ref input);
            }

            CustomerCollection collection = new CustomerCollection();
            var customers = DataParser.Execute(lines, input.Delimiter);

            collection.AddRange(customers);

            return(collection.Sort(input.CommandOption));
        }