Example #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"));
        }
Example #2
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());
        }