def setUp(self):
        self.__DisciplineRepo = Repository(DisciplineValidator())
        d1 = Discipline(1, "mate", "prof mate")
        d2 = Discipline(2, "info", "prof info")
        self.__DisciplineRepo.add_item(d1)
        self.__DisciplineRepo.add_item(d2)
        self.__Dctrl = DisciplineController(self.__DisciplineRepo)

        self.__StudentRepo = Repository(StudentValidator())
        s1 = Student(3, "Ion")
        s2 = Student(2, "Maria")
        s3 = Student(1, "Ionica")
        self.__StudentRepo.add_item(s1)
        self.__StudentRepo.add_item(s2)
        self.__StudentRepo.add_item(s3)
        self.__Sctrl = StudentController(self.__StudentRepo)

        self.__repo = Repository(StudentDisciplineValidator())
        sd = Student_Discipline(1, s1.get_student_id(), d1.get_discipline_id(),
                                6)
        self.__repo.add_item(sd)

        sd = Student_Discipline(2, s2.get_student_id(), d2.get_discipline_id(),
                                8)
        self.__repo.add_item(sd)

        sd = Student_Discipline(4, s3.get_student_id(), d2.get_discipline_id(),
                                3)
        self.__repo.add_item(sd)
        self.__ctrl = StudentDisciplineController(self.__StudentRepo,
                                                  self.__DisciplineRepo,
                                                  self.__repo)
Exemplo n.º 2
0
    def main(self):
        student_repo = Repository(StudentValidator())
        sc = StudentController(student_repo)

        discipline_repo = Repository(DisciplineValidator())
        dc = DisciplineController(discipline_repo)

        cons = Console(sc, dc)
        cons.run()
Exemplo n.º 3
0
 def setUp(self):
     self.__repo = Repository(StudentValidator())
     s1 = Student(1, "s1")
     s2 = Student(2, "s2")
     s3 = Student(3, "s3")
     self.__repo.add_item(s1)
     self.__repo.add_item(s2)
     self.__repo.add_item(s3)
Exemplo n.º 4
0
 def setUp(self):
     self.__repo = Repository(StudentValidator())
     s1 = Student(1, "s1")
     s2 = Student(2, "s2")
     s3 = Student(3, "s3")
     self.__repo.save(s1)
     self.__repo.save(s2)
     self.__repo.save(s3)
     self.__ctrl = StudentController(self.__repo)
Exemplo n.º 5
0
 def setUp(self):
     self.__repo = Repository(DisciplineValidator())
     d1 = Discipline(1, "d1", "p1")
     d2 = Discipline(2, "d2", "p2")
     d3 = Discipline(3, "d3", "p3")
     self.__repo.save(d1)
     self.__repo.save(d2)
     self.__repo.save(d3)
     self.__ctrl = DisciplineController(self.__repo)