Closed
Description
Description
The approach outlined in https://learn.microsoft.com/aspnet/core/test/integration-tests?view=aspnetcore-9.0#customize-webapplicationfactory no longer works. It was relying on implementation details, see #35126
It is also recommended to use the same provider for testing as the one used in production as they could have drastically different behaviors, see testing against the production database.
The connection / connection string for the same provider can be changed easily:
services.ConfigureDbContext<TestContext>(options => options.UseSqlite(connection));
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/test/integration-tests.md
Document ID
f499b131-8b14-7e10-1728-543fdd5a5656
Article author
Metadata
- ID: 77889d43-fedb-f8b4-8fea-379ec946555c
- Service: aspnet-core
- Sub-service: testing
Activity
Rick-Anderson commentedon Jan 29, 2025
@jvandertil @martincostello can one of you take this?
8 remaining items