public ActionResult GetAllBooks() { List <BookResponse> books = _libraryLogic.GetAllBooks(); return(Ok(new Response <List <BookResponse> > { Status = "200", ResponseMessage = "Data Retrieved Successfully", ResponseData = books })); }
public void TestGetAllBooks() { List <BookResponse> bookResponses = myLogic.GetAllBooks(); Assert.IsTrue(bookResponses.Count == 2); Assert.IsTrue(bookResponses[0].Author == "Bob"); Assert.IsTrue(bookResponses[1].Author == "Sam"); Assert.IsTrue(bookResponses[1].NumPages == 600); }