Example #1
0
        public string Calculate(CalculatorInput alculatorInput)
        {
            var values = _parser.Parse(alculatorInput.Input, alculatorInput.AlternateDelimiter);

            var validNumbers = _validator.Validate(values, alculatorInput.AllowNegative, alculatorInput.MaxNumber);

            var response = _calculator.Run(
                _operatorProvider.GetByOperation(alculatorInput.Operation),
                validNumbers,
                _operatorProvider.GetSymbolByOperation(alculatorInput.Operation));

            return(response.ToString());
        }