public void SetUp()
        {
            _binaryOperations = new List <BinaryOperation <decimal> >
            {
                new BinaryOperation <decimal>("+", 10, (a, b) => a + b),
                new BinaryOperation <decimal>("-", 11, (a, b) => a - b),
                new BinaryOperation <decimal>("*", 21, (a, b) => a * b),
                new BinaryOperation <decimal>("/", 22, (a, b) => a / b),
            };

            _validator = new ExpressionsValidator <decimal>();
        }
Пример #2
0
 public Calculator(IParser <T> parser, IExpressionsValidator <T> validator, IExpressionFormatter formatter)
 {
     _validator = validator;
     _parser    = parser;
     _formatter = formatter;
 }