예제 #1
0
def test_adauga_repo_student():
    repo_st = repo_student()
    st = student(12, 'Ion', 30)
    repo_st.adauga_repo_student(st)
    assert repo_st.getNumar() == 1
    st2 = student(1, 'Ana', 88)
    repo_st.adauga_repo_student(st2)
    assert repo_st.getNumar() == 2
예제 #2
0
def testGetToti():
    repo_st = repo_student()
    st = student(12, 'Ion', 30)
    st1 = student(1, 'Ana', 88)
    repo_st.adauga_repo_student(st)
    repo_st.adauga_repo_student(st1)
    lista = repo_st.getToti()
    assert lista == [st, st1]
예제 #3
0
def test_actualizeaza_repo_student():
    repo_st = repo_student()
    st = student(12, 'Ion', 30)
    nume_nou = 'Ana'
    grup_nou = 88
    repo_st.adauga_repo_student(st)
    repo_st.actualizeaza_repo_student(st.get_studentID(), nume_nou, grup_nou)
    assert st.get_nume() == nume_nou
    assert st.get_grup() == grup_nou
예제 #4
0
def test_create_repo():
    repo_st = repo_student()
    assert repo_st.getNumar() == 0
예제 #5
0
def test_sterge_repo_student():
    repo_st = repo_student()
    st = student(12, 'Ion', 30)
    repo_st.adauga_repo_student(st)
    repo_st.sterge_repo_student(st.get_studentID())
    assert repo_st.getNumar() == 0
예제 #6
0
 def setUp(self):
     val = valid_student()
     repo = repo_student()
     self.ctr = student_service(repo, val)
     self.ctr.adauga_student(1, "Ion", 7)
     self.ctr.adauga_student(2, "Mihai", 7)