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)); }
public void IntExpressionParser_Parse_ExceptionTest(string input, string[] variableNames) { var expressionParser = new IntExpressionParserFactory().Create(variableNames); Assert.Throws <ParserException>(() => expressionParser.Parse(input)); }