Beispiel #1
0
        public void testConstructor2AttributesAnd()
        {
            String                statement = "Company with 1 as id and \"IBM\" as name";
            ETestParser           parser    = new ETestParser(statement, false);
            ConstructorExpression c         = parser.parse_constructor_expression();

            Assert.IsNotNull(c);
            ArgumentList l = c.getArguments();

            Assert.IsNotNull(l);
            Assert.AreEqual(2, l.Count);
            Argument a = l[0];

            Assert.IsNotNull(a);
            Assert.AreEqual("id", a.GetName());
            IExpression e = a.getExpression();

            Assert.IsNotNull(e);
            Assert.IsTrue(e is IntegerLiteral);
            a = l[1];
            Assert.IsNotNull(a);
            Assert.AreEqual("name", a.GetName());
            e = a.getExpression();
            Assert.IsNotNull(e);
            Assert.IsTrue(e is TextLiteral);
        }
Beispiel #2
0
        public void testConstructorFrom1Attribute()
        {
            String                statement = "Company from entity with 1 as id";
            ETestParser           parser    = new ETestParser(statement, false);
            ConstructorExpression c         = parser.parse_constructor_expression();

            Assert.IsNotNull(c);
        }