Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Customize WebApplicationFactory" section doesn't work with EF 9.0 #34584

Open
AndriySvyryd opened this issue Jan 28, 2025 · 1 comment
Open
Labels
aspnet-core/svc Source - Docs.ms Docs Customer feedback via GitHub Issue testing/subsvc

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jan 28, 2025

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

https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-9.0#customize-webapplicationfactory

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

@tdykstra

Metadata

  • ID: 77889d43-fedb-f8b4-8fea-379ec946555c
  • Service: aspnet-core
  • Sub-service: testing

Related Issues

@AndriySvyryd AndriySvyryd added ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels Jan 28, 2025
@AndriySvyryd AndriySvyryd changed the title Customize WebApplicationFactory section doesn't work with EF 9.0 "Customize WebApplicationFactory" section doesn't work with EF 9.0 Jan 28, 2025
@Rick-Anderson
Copy link
Contributor

@jvandertil @martincostello can one of you take this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspnet-core/svc Source - Docs.ms Docs Customer feedback via GitHub Issue testing/subsvc
Projects
Status: To do
Development

No branches or pull requests

2 participants