Ejemplo n.º 1
0
        public void SubstractIntegracion()
        {
            var validator = new LimitsValidator(-100, 100);
            var calculator = new Calculator();
            var proxy = new CalculatorProxy(validator);

            var result = proxy.BinaryOperation(calculator.Substract, 5, 3);
            Assert.AreEqual(2, result);
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     var expressionValidator = new MathRegex();
     var expressionFixer = new ExpressionFixer(expressionValidator);
     this.lexer = new MathLexer(expressionValidator, expressionFixer);
     var limitsValidator = new LimitsValidator(-100, 100);
     var proxy = new CalculatorProxy(limitsValidator);
     var calculator = new Calculator();
     var operatorFactory = new OperatorFactory(proxy, calculator);
     this.parser = new MathParser(this.lexer, operatorFactory);
 }
Ejemplo n.º 3
0
 public void SetUp()
 {
     calculator = new Calculator();
 }