Exemplo n.º 1
0
  def test_findPersonById(self):
    repo = PersonRepository()
    cont = PersonsController(repo, PersonsActivitiesRepo(), UndoRedoController())

    cont.addPerson(Person(1, "Razvan", 123, "Cluj"))

    self.assertEqual(Person(1, "Razvan", 123, "Cluj"), cont.findPersonById(1))
Exemplo n.º 2
0
  def test_update(self):
    repo = PersonRepository()
    cont = PersonsController(repo, PersonsActivitiesRepo(), UndoRedoController())

    cont.addPerson(Person(1, "Razvan", 123, "Cluj"))
    cont.addPerson(Person(2, "Razvan", 321, "Zalau"))
    cont.addPerson(Person(3, "Alex", 12231233, "Iasi"))

    cont.update(2, "Heghedus", 1212, "Deva")

    self.assertEqual(cont.findPersonById(2), Person(2, "Heghedus", 1212, "Deva"))