public void TestBookSearch() { String searchString = "Abhishek"; IBookService bookService = new BookService(); IList<Book> returnedList = bookService.BookSearch(searchString); Book book = returnedList.FirstOrDefault(); Console.Write(book.Price); Assert.IsNotNull(returnedList.FirstOrDefault()); }
public ActionResult SearchBook(String userId , String searchString) { try { ViewBag.userId = userId; IBookService bookService = new BookService(); IList<Book> bookList = bookService.BookSearch(searchString); return View(bookList); } catch (Exception e) { Console.WriteLine("SearchBook Error"); Console.Write(e.ToString()); return Content("Error"); } }