Exemplo n.º 1
0
 def testBook(self):
     '''
     Method to test the getter and the setter of the Book class
     '''
     book = Book(1, "Introduction to algorithms", "The Bible", "Thomas H Cormen")
     self.assertEqual(self.getId(), 1)
     assert book.getTitle() == "Introduction to algorithms"
     assert book.getDescription() == "The Bible"
     assert book.getAuthor() == "Thomas H Cormen"
     book.setAuthor("Cosmin")
     assert book.getAuthor() == "Cosmin"
     book.setTitle("Title")
     assert book.getTitle() == "Title"
     book.setDescription("Descr")
     assert book.getDescription() == "Descr"
Exemplo n.º 2
0
 def testBook(self):
     '''
     Method to test the getter and the setter of the Book class
     '''
     book = Book(1, "Introduction to algorithms", "The Bible",
                 "Thomas H Cormen")
     self.assertEqual(self.getId(), 1)
     assert book.getTitle() == "Introduction to algorithms"
     assert book.getDescription() == "The Bible"
     assert book.getAuthor() == "Thomas H Cormen"
     book.setAuthor("Cosmin")
     assert book.getAuthor() == "Cosmin"
     book.setTitle("Title")
     assert book.getTitle() == "Title"
     book.setDescription("Descr")
     assert book.getDescription() == "Descr"