Esempio n. 1
0
        public void LiteralInteger_GivenInteger_ReturnsIntegerLiteral(int input, int expected)
        {
            IntegerLiteralExpression intLit = new IntegerLiteralExpression(input.ToString(), 1, 1);
            IInterpreterInteger      parent = Substitute.For <IInterpreterInteger>();

            parent.DispatchInt(intLit, Arg.Any <List <object> >()).Returns(input);
            IntegerHelper integerHelper = SetUpHelper(parent);

            int res = integerHelper.LiteralInteger(intLit, new List <object>());

            Assert.AreEqual(expected, res);
        }