Exemplo n.º 1
0
        public void IntExpressionParser_Parse_ValidInputTest(
            string input, string[] variableNames, int[] parameters, int expectedValue)
        {
            var expressionParser = new IntExpressionParserFactory().Create(variableNames);
            var handler          = expressionParser.Parse(input);

            int value = handler(parameters);

            Assert.That(value, Is.EqualTo(expectedValue));
        }
Exemplo n.º 2
0
        public void IntExpressionParser_Parse_ExceptionTest(string input, string[] variableNames)
        {
            var expressionParser = new IntExpressionParserFactory().Create(variableNames);

            Assert.Throws <ParserException>(() => expressionParser.Parse(input));
        }