docs/en/testing/overall.md
//[doc-seo]
{
"Description": "Explore ABP Framework's automated testing strategies, including unit, integration, and UI tests, to enhance your application's reliability and performance."
}
//[doc-nav]
{
"Next": {
"Name": "Unit tests",
"Path": "testing/unit-tests"
}
}
ABP has been designed with testability in mind. There are some different levels of automated testing;
Integration tests have some significant advantages compared to unit tests;
While they have some drawbacks;
We suggest to go mixed: Write unit or integration test where it is necessary and you find effective to write and maintain it.
The Application Startup Template comes with the test infrastructure properly installed and configured for you.
See the following solution structure in the Visual Studio:
There are more than one test project, organized by the layers;
Domain.Tests is used to test your Domain Layer objects (like Domain Services and Entities).Application.Tests is used to test your Application Layer (like Application Services).EntityFrameworkCore.Tests is used to implement abstract test classes and test your custom repository implementations or EF Core mappings (this project will be different if you use another Database Provider).Web.Tests is used to test the UI Layer (like Pages, Controllers and View Components). This project does only exist for MVC / Razor Page applications.TestBase contains some classes those are shared/used by the other projects.
HttpApi.Client.ConsoleTestAppis not an automated test application. It is an example Console Application that shows how to consume your HTTP APIs from a .NET Console Application.
The following sections will introduce the base classes and other infrastructure included in these projects.
The startup solution has the following libraries already installed;
While you are free to replace them with your favorite tools, this document and examples will be based on these tooling.
You can use the Test Explorer to view and run the tests in Visual Studio. For other IDEs, see their own documentation.
Open the Test Explorer, under the Tests menu, if it is not already open:
Then you can click to the Run All or Run buttons to run the tests. The initial startup template has some sample tests for you:
The test infrastructure is compatible to run the tests in parallel. It is strongly suggested to run all the tests in parallel, which is pretty faster then running them one by one.
To enable it, click to the caret icon near to the settings (gear) button and select the Run Tests In Parallel.