예제 #1
0
        public void TestIfGetBorrowedBooksReturnsCorrectValues()
        {
            var books = clientBusiness.GetBorrowedBooks(2);

            Assert.AreEqual(2, books.Count, "Doesn't return correct number of clients!");
            Assert.AreEqual("AAA", books[0].Title, "Book 1 isn't equal to AAA");
            Assert.AreEqual("CCC", books[1].Title, "Book 2 isn't equal to CCC");
        }
예제 #2
0
        private void FetchBooksBorrowedByClient()
        {
            Console.WriteLine("Enter Client Id: ");
            int    Id     = int.Parse(Console.ReadLine());
            Client client = clientBusiness.Get(Id);

            if (client != null)
            {
                List <Book> books = clientBusiness.GetBorrowedBooks(Id);
                Console.WriteLine(new string('-', 40));
                Console.WriteLine(new string(' ', 16) + "Books" + new string(' ', 16));
                Console.WriteLine(new string('-', 40));
                foreach (var book in books)
                {
                    Console.WriteLine("{0} || {1}", book.Id, book.Title);
                }
            }
            else
            {
                Console.WriteLine("Client not found!");
            }
        }