Пример #1
0
        public void ParseEmptyFunctionDefinitionTest()
        {
            FunctionParser     functionParser           = new FunctionParser(Init("home(param1, param2) \n end"));
            FunctionDefinition parsedFunctionDefinition = functionParser.ParseFunctionDefinition();

            //Test FunctionDefinition
            Assert.AreEqual("home", parsedFunctionDefinition.GetIdentifier());
            Assert.AreEqual(2, parsedFunctionDefinition.GetFormals().Count);

            //Check formals
            Formal[] formalArray = (Formal[])parsedFunctionDefinition.GetFormals().ToArray();
            Assert.AreEqual("param1", formalArray[0].ToString());
            Assert.AreEqual("param2", formalArray[1].ToString());
        }