Exemple #1
0
        public void testCategory1Attribute()
        {
            String              statement = "define Person as category with attribute id ";
            ETestParser         parser    = new ETestParser(statement, false);
            CategoryDeclaration cd        = parser.parse_category_declaration();

            Assert.IsNotNull(cd);
            Assert.AreEqual("Person", cd.GetName());
            Assert.IsNull(cd.getDerivedFrom());
            Assert.IsNotNull(cd.GetLocalAttributes());
            Assert.IsTrue(cd.GetLocalAttributes().Contains("id"));
        }
Exemple #2
0
        public void parsesCategory1Attribute()
        {
            String              statement = "category Person ( id );";
            OTestParser         parser    = new OTestParser(statement);
            CategoryDeclaration cd        = parser.parse_category_declaration();

            Assert.IsNotNull(cd);
            Assert.AreEqual("Person", cd.GetName());
            Assert.IsNull(cd.getDerivedFrom());
            Assert.IsNotNull(cd.GetLocalAttributes());
            Assert.IsTrue(cd.GetLocalAttributes().Contains("id"));
        }
Exemple #3
0
        public void parsesCategory1Derived1Attribute()
        {
            String              statement = "category Employee( company ) extends Person ;";
            OTestParser         parser    = new OTestParser(statement);
            CategoryDeclaration cd        = parser.parse_category_declaration();

            Assert.IsNotNull(cd);
            Assert.AreEqual("Employee", cd.GetName());
            Assert.IsNotNull(cd.getDerivedFrom());
            Assert.IsTrue(cd.getDerivedFrom().Contains("Person"));
            Assert.IsNotNull(cd.GetLocalAttributes());
            Assert.IsTrue(cd.GetLocalAttributes().Contains("company"));
        }
Exemple #4
0
        public void testCategory2DerivedNoAttribute()
        {
            String              statement = "define Entrepreneur as Person and Company";
            ETestParser         parser    = new ETestParser(statement, false);
            CategoryDeclaration cd        = parser.parse_category_declaration();

            Assert.IsNotNull(cd);
            Assert.AreEqual("Entrepreneur", cd.GetName());
            Assert.IsNotNull(cd.getDerivedFrom());
            Assert.IsTrue(cd.getDerivedFrom().Contains("Person"));
            Assert.IsTrue(cd.getDerivedFrom().Contains("Company"));
            Assert.IsNull(cd.GetLocalAttributes());
        }
Exemple #5
0
        public void parsesCategory2DerivedNoAttribute()
        {
            String              statement = "category Entrepreneur extends Person, Company;";
            OTestParser         parser    = new OTestParser(statement);
            CategoryDeclaration cd        = parser.parse_category_declaration();

            Assert.IsNotNull(cd);
            Assert.AreEqual("Entrepreneur", cd.GetName());
            Assert.IsNotNull(cd.getDerivedFrom());
            Assert.IsTrue(cd.getDerivedFrom().Contains("Person"));
            Assert.IsTrue(cd.getDerivedFrom().Contains("Company"));
            Assert.IsNull(cd.GetLocalAttributes());
        }