Ejemplo n.º 1
0
 def add_class(self, class_name, attributes, methods, relationships):
     new_class = ClassBuilder()
     new_class.build_class(class_name, attributes, methods, relationships)
     self.all_my_classbuilders.append(new_class)
Ejemplo n.º 2
0
 def test_02(self):
     tester = ClassBuilder()
     tester.build_class("ClassName",
                        ["attribute1: string", "attribute2: int"],
                        ["Method1(input):integer"], ("extends", "Class2"))
     assert len(tester.all_my_attributes) is 2
Ejemplo n.º 3
0
 def test_01(self):
     tester = ClassBuilder()
     tester.build_class("Name", ["attribute1: string"],
                        ["Method1(input):integer"], ("extends", "Class2"))
     assert tester.name is "Name"
Ejemplo n.º 4
0
 def test_03(self):
     x = ClassBuilder()
     x.build_class("ClassName", ["attribute1: string"],
                   ["Method1(input):integer", "Method2(str):hello"],
                   ("extends", "Class2"))
     assert len(x.all_my_methods) is 2
Ejemplo n.º 5
0
 def test_04(self):
     x = ClassBuilder()
     x.build_class("ClassName", ["attribute1: string"],
                   ["Method1(input):integer"], ("comp", "Class2"))
     assert len(x.relationships) > 0
Ejemplo n.º 6
0
 def test_01(self):
     x = ClassBuilder()
     x.build_class("ClassName", ["attribute1: string"],
                   ["Method1(input):integer"], ("extends", "Class2"))
     assert x.name is "ClassName"
Ejemplo n.º 7
0
 def add_class(self, args):
     new_class = ClassBuilder()
     new_class.build_class(args)
     self.all_my_classbuilders.append(new_class)
Ejemplo n.º 8
0
 def add_class(cls, args):
     new_class = ClassBuilder()
     new_class.build_class(args)
     return new_class