public void testIntegerLiteralExp()
        {
            AstOclModelElementFactory factory1 = AstOclModelElementFactoryManager.getInstance(umlModel.getOclPackage());
            IntegerLiteralExp         exp1     = factory1.createIntegerLiteralExp(100, getClassifier("Integer"));

            Assert.AreEqual("100", exp1.ToString());
            Assert.AreEqual("Integer", exp1.getType().getName());
        }
Exemple #2
0
        private void doTestInteger(int expectedValue)
        {
            CSTNode node = parseOK(expectedValue.ToString(CultureInfo.InvariantCulture), this.getCurrentMethodName());

            Assert.IsTrue(node is CSTIntegerLiteralExpCS);
            CSTIntegerLiteralExpCS literalExp = (CSTIntegerLiteralExpCS)node;

            Assert.IsNotNull(literalExp.getAst());
            Assert.IsTrue(literalExp.getAst() is IntegerLiteralExp);
            IntegerLiteralExp ast = (IntegerLiteralExp)literalExp.getAst();

            Assert.AreEqual(expectedValue, ast.getIntegerSymbol());
            CoreClassifier type = ast.getType();

            Assert.IsNotNull(type);
            Assert.AreEqual("Integer", type.getName());
        }