E
E
embiid2021-05-13 16:35:01
ASP.NET
embiid, 2021-05-13 16:35:01

How to start learning Unit Testing?

Purely for myself, I want to understand how to work and where to start testing the application, I'm interested in a web application.
For example, there is a small crud application that is divided into controllers, services and repositories.
How and what should be tested, is it necessary to test a repository, or a service, or a controller in general?
I saw that there are many of them, such as Moq, XUnit and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-05-13
@embiid

How to start learning Unit Testing?

With tests covering simple modules (which do not depend on other modules), which do not have side effects (do not go to disk or network, do not ask the user anything).
A module can be a method or a class.
You can also read the book
I saw that there are many of them, such as Moq, XUnit and so on.

These are tools for solving different problems.
Moq - for creating mock objects
XUnit - directly a framework for describing and running tests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question