コード例 #1
0
 def TestSetIdStudent(self):
     '''
     Testeaza functia de setare a unui id a unui student
     '''
     stud = Student(12, 'ASD')
     Student.SetIdStudent(stud, 1)
     assert Student.GetIdStudent(stud) == 1
コード例 #2
0
 def TestInit(self):
     '''
     Testeaza functia de initializare a unui student
     '''
     studNou = Student(1, 'Tofan Paul-Adrian')
     assert studNou.GetIdStudent() == 1
     assert studNou.GetNumeStudent() == 'Tofan Paul-Adrian'
コード例 #3
0
 def ValidareStudent(self, stud):
     '''
     Valideaza un student
     '''
     erori = ''
     if self.__validator.ValidareId(Student.GetIdStudent(stud)) == False:
         erori += 'Id-ul introdus nu este valid.'
     if self.__validator.ValidareNume(
             Student.GetNumeStudent(stud)) == False:
         erori += 'Numele introdus nu este valid.'
     if len(erori) > 0:
         raise ValidationStudentException(erori)
コード例 #4
0
 def TestGetIdStudent(self):
     '''
     Testeaza functia de obtinere a unui id a unui student 
     '''
     assert (Student.GetIdStudent(Student(10, 'Tofan')) == 10)
     assert (Student.GetIdStudent(Student(312, 'Tofan')) == 312)