def test_addPersonActivity(self): repo = PersonsActivitiesRepo() cont = PersonActivityController(repo, UndoRedoController()) cont.addPersonActivity(1, 1) self.assertIn(repo.findById(1), cont.getAll())
def test_removePersonActivity(self): repo = PersonsActivitiesRepo() cont = PersonActivityController(repo, UndoRedoController()) cont.addPersonActivity(1, 1) pa = repo.findById(1) cont.removePersonActivity(1, 1) self.assertNotIn(pa, cont.getAll())
def test_getAll(self): repo = PersonsActivitiesRepo() cont = PersonActivityController(repo, UndoRedoController()) cont.addPersonActivity(1, 1) cont.addPersonActivity(1, 2) cont.addPersonActivity(1, 3) cont.addPersonActivity(2, 1) cont.addPersonActivity(2, 2) cont.addPersonActivity(3, 1) cont.addPersonActivity(4, 2) self.assertEqual(cont.getAll(), repo.getAll())