public void Copy_GetAllCheckouts_ReturnAllCheckoutInfo()
        {
            Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();
              Book firstBook = new Book("Cats", testDate, 2);
              firstBook.Save();
              firstBook.StockBook();
              Book secondBook = new Book("Dogs", testDate, 2);
              secondBook.Save();
              secondBook.StockBook();

              firstPatron.CheckoutBook(firstBook.GetCopies()[0].GetId(), testDate2);
              firstPatron.CheckoutBook(secondBook.GetCopies()[0].GetId(), testDate);

              Dictionary<string, object> result = Copy.GetAllCheckouts();
              List<Patron> expectedPatrons = new List<Patron>{firstPatron, firstPatron};
              List<Copy> expectedCopies = new List<Copy>{firstBook.GetCopies()[0], secondBook.GetCopies()[0]};
              List<DateTime?> expectedDueDates = new List<DateTime?>{testDate2, testDate};

              Assert.Equal(result["patrons"], expectedPatrons);
              Assert.Equal(result["copies"], expectedCopies);
              Assert.Equal(result["dueDates"], expectedDueDates);
        }
        public void Patron_Checkout_ChecksoutABook()
        {
            Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();
              Book newBook = new Book("Cats", testDate, 2);
              newBook.Save();
              newBook.StockBook();

              firstPatron.CheckoutBook(newBook.GetCopies()[0].GetId(), testDate2);

              List<Copy> result = firstPatron.GetCheckOutRecord(false);
              List<Copy> expectedResult = newBook.GetCopies();

              Assert.Equal(expectedResult, result);
        }
        public void Book_GetCheckedOutCopies()
        {
            Book newBook = new Book("Cathedrals", testDate, 2);
              newBook.Save();
              Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();

              newBook.StockBook();
              newBook.StockBook();
              newBook.StockBook();
              firstPatron.CheckoutBook(newBook.GetCopies()[0].GetId(), testDate2);
              firstPatron.CheckoutBook(newBook.GetCopies()[2].GetId(), testDate2);

              List<Copy> expectedResult = new List<Copy>{newBook.GetCopies()[0], newBook.GetCopies()[2]};
              List<Copy> result = newBook.GetCheckedOutCopies();

              Assert.Equal(expectedResult, result);
        }
        public void Patron_ReturnBook_ReturnsCheckedoutBook()
        {
            Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();
              Book newBook = new Book("Cats", testDate, 2);
              newBook.Save();
              newBook.StockBook();

              firstPatron.CheckoutBook(newBook.GetCopies()[0].GetId(), testDate2);
              firstPatron.ReturnBook(newBook.GetCopies()[0].GetId());

              int result = firstPatron.GetCheckOutRecord(false).Count;

              Assert.Equal(0, result);
        }
        public void Patron_GetDueDate_GetsDueDateOfCheckedOutBook()
        {
            Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();
              Book newBook = new Book("Cats", testDate, 2);
              newBook.Save();
              newBook.StockBook();

              firstPatron.CheckoutBook(newBook.GetCopies()[0].GetId(), testDate2);
              DateTime? result = firstPatron.GetReturnDate(newBook.GetCopies()[0].GetId());
              DateTime? expectedResult = testDate2;

              Assert.Equal(expectedResult, result);
        }
        public void Patron_GetCheckoutHistory_ReturnsCheckOutHistory()
        {
            Patron firstPatron = new Patron("Mayor McCheese");
              firstPatron.Save();
              Book firstBook = new Book("Cats", testDate, 2);
              firstBook.Save();
              firstBook.StockBook();
              Book secondBook = new Book("Dogs", testDate, 2);
              secondBook.Save();
              secondBook.StockBook();

              firstPatron.CheckoutBook(firstBook.GetCopies()[0].GetId(), testDate2);
              firstPatron.CheckoutBook(secondBook.GetCopies()[0].GetId(), testDate2);
              firstPatron.ReturnBook(firstBook.GetCopies()[0].GetId());

              Copy result = firstPatron.GetCheckOutRecord(true)[0];
              Copy expectedResult = firstBook.GetCopies()[0];
              Assert.Equal(expectedResult, result);
        }