This project serves as an example of how to use and test Entity Framework Core in an ASP.Net Core application.
It makes use of the following technologies and projects:
- .NET 8.0
- ASP.NET Core 8.0
- Swashbuckle
- Entity Framework Core
- Docker
- SQL Server
- XUnit
- FluentAssertions
- TestContainers
- Coverlet
- ReportGenerator
Make sure to have docker running, and run the Docker Compose project from Visual Studio, or from a terminal by executing docker compose up
in the root folder.
Access the web api at http://localhost:54876/swagger and try to call the endpoints for the resources CRUD operations.
Make sure to have docker running, and run the tests from the Test Explorer in Visual Studio, or from a terminal by executing dotnet test .\AspNetCore.Examples.EntityFrameworkCore.sln
in the root folder.
More about ASP.NET Core 8.0 integration tests
To run tests and generate an html coverage analysis report, run the coverage_report.ps1
powershell script in the root folder.
More about code coverage for unit testing in .NET