Closed hellfirehd closed 4 years ago
Thanks for the report @hellfirehd - The culprit is IdentityServer's DbContext is using the hardwired connection string/DB instead of the InMemory database when running under the test.
This one should be easy to fix, I should be able to get it patched up tonight.
AuthServer Startup.cs
This line:
options.ConfigureDbContext = ctxBuilder => ctxBuilder.UseSqlServer(Configuration.GetConnectionString(_connectionStringName));
needs to be something like this for testing:
options.ConfigureDbContext = ctxBuilder => ctxBuilder.UseInMemoryDatabase("InMemoryDbForTesting");
CanCreateAccount succeeds.
Error:
An unhandled exception occurred while processing the request. SqlException: Cannot open database "FullStackJobs" requested by the login. The login failed. Login failed for user 'DOMAIN\user'.
Repro:
Clone the project Open the solution Run the tests
Impact:
I was hoping to be able to run the tests on a CI server without having to configure a local database