Creating an Application from Scratch using .NET Core and Angular — Part 7

Install-Package Moq
  • CreateBook — which create a single Book
  • MapModelToBookResultDto — which do the mapping converting a Book entity to a BookResultDto
  • CreateBookList — which create a list of Book
  • MapModelToBookResultListDto— which do the mapping converting a List of Book entity to a List of BookResultDto
  • GetAll
  • GetById
  • GetBooksByCategory
  • Add
  • Update
  • Remove
  • Search
  • SearchBookWithCategory
  • The method returns Ok when a book exists
  • The method returns Ok when do not exist any book
  • The method calls the GetAll method from the Service class only one time
  • The method returns Ok when a book exists
  • The method returns NotFound when a book does not exist
  • The method calls the GetById method from the Service class only one time
  • The method returns Ok when book with searched category exists
  • The method returns NotFound when book with the searched category does not exist
  • The method calls the GetBooksByCategory method from the Service class only one time
  • The method returns Ok when the book is added
  • The method returns BadRequest when the model state is invalid
  • The method returns BadRequest when the book is not added
  • The method calls the Add method from the Service class only one time
  • The method returns Ok when the book is updated correctly
  • The method returns BadRequest when the book id is different than the parameter id
  • The method returns BadRequest when the model state is invalid
  • The method calls the Update method from the Service class only one time
  • The method returns Ok when the book is removed
  • The method returns NotFound when the book does not exist
  • The method calls the Remove method from the Service class only one time
  • The method returns Ok when book with searched name exists
  • The method returns NotFound when book with searched name does not exist
  • The method calls the Search method from the Service class only one time
  • The method returns Ok when book with the searched value exists
  • The method returns NotFound when book with the searched value does not exist
  • The method calls the SearchBookWithCategory method from the Service class only one time
https://github.com/henriquesd/BookStore

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store