def testCreateClient(self): ''' Function that checks whether a client is properly added to a list or not. input:- preconditions:- output:- postconditions: If the client is not added correctly, an error will appear. ''' client = Client(4, "Hagrid Fluffy") self.assertEqual(client._Client__getId(), 4) self.assertEqual(client._Client__getName(), "Hagrid Fluffy") client._Client__setId(7) self.assertEqual(client._Client__getId(), 7) client._Client__setName("Tinkerbell Fairydust") self.assertEqual(client._Client__getName(), "Tinkerbell Fairydust")
def testUpdateClient(self): ''' Function that checks whether a client is correctly updated or not. input:- preconditions:- output:- postconditions: If the client is not correctly updated, an error will appear. ''' mylist = [] client = Client(5, "Cho Chang") client._Client__addClient(mylist) client._Client__updateClient(5, 3, "Hermione Granger", mylist) self.assertEqual(client._Client__getId(), 3) self.assertEqual(client._Client__getName(), "Hermione Granger")