Exemple #1
0
        static int Main(string[] args)
        {
            var validator           = new ArgumentsCountValidator();
            var operationValidator  = new OperationValidator();
            var sourceFileValidator = new SourceFileValidator(new DestinationFileValidator(null));

            validator.SetChildValidator(operationValidator);
            operationValidator.SetChildValidator(sourceFileValidator);

            var validationResult = validator.Validate(args);

            if (validationResult.Succeeded == false)
            {
                Console.WriteLine(validationResult.ErrorMessage);
                return(1);
            }

            _actions[args[0].ToLower()](args[1], args[2]);

            zipper.Start();

            if (zipper.ResultCode == 0)
            {
                Console.WriteLine("Done!");
            }

            return(zipper.ResultCode);
        }
        private void ActAndAssert()
        {
            var argumentsValidator = new ArgumentsCountValidator(arguments);

            argumentsValidator.Validate();
        }