Exemplo n.º 1
0
 public static void testBook()
 {
     // Small test of the Book class
     Book example = new Book("The Da Vinci Code");
     Console.WriteLine("Title should be The Da Vinci Code): " + example.getTitle());
     Console.WriteLine("Borrowed? (should be false): " + example.isBorrowed());
     //example.rented();
     Console.WriteLine("Borrowed? (should be true): " + example.isBorrowed());
     example.returned();
     Console.WriteLine("Borrowed? (should be false): " + example.isBorrowed());
 }
Exemplo n.º 2
0
 public void addBook(Book book)
 {
     if (book == null) { Console.WriteLine("error"); Console.ReadKey(); }
     try
     {
         bookList.Add(book);
     }
     catch (Exception e)
     {
         Console.WriteLine("Error {0}", e);
         Console.ReadKey();
     }
 }