I am create a multi-tenant API using clean architecture and FinBuckle 7.0.1. My unit tests run fine, and my functional tests where I can set the tenant identifier in the client header, work fine, however, I am unable to get the integration tests to run, as the tenantinfo instance in the AppDbContext is always null. During the test setup where I spin up a new SQL server in docker, build and populate the datebase with test data, the DbContext works. But durng the test execution the tenantindo is always null.
Has anyone successfully created Integration tests which “injects” a tenant via the WebApplicationFactory?
I have been trying for several days, and used every suggestion I can find on the web, even used a static tenant, but always when the test runs, the tenant instance in the AppDbContext is null.
I would be grateful for any suggestions.
Mark Townsend is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.