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

  • XUnit — The newest from this list. It was written by the original inventor of NUnit v2. This framework is used by the development team of .NET Core and ASP.NET.
  • NUnit — A JUnit version for .NET.
  • MSTest — Framework from Microsoft.
[Fact]
pubic async Task Example_Of_UnitTest()
{
// Arrange
// Act// Assert
}
Install-Package Moq
  • GetAll
  • GetById
  • Add
  • Update
  • Remove
  • Search
  • The method returns a list of categories if some category exists
  • The method returns null if no categories exist
  • The method calls the GetAll method from the repository class only one time
  • The method returns a category when the category exists
  • The method returns null when the searched category does not exist
  • The method calls the GetById method from the repository class only one time
  • The method adds a category when the category name does not exist
  • The method does not add a category when the category name already exists
  • The method calls the Add method from the repository class only one time
  • The method updates a category with the new name when the new category name does not exist
  • The method does not update a category when the updated category name already exists
  • The method calls the Update method from the repository class only one time
  • The method removes a category when the category does not have any related book
  • The method does not remove a category when the category has a related book
  • The method should call the Remove method from the repository class only one time
  • The method returns a list of categories when categories with searched name exist
  • The method returns null when do not exists any category with the searched name
  • The method should call the Search method from the repository 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