Reputation: 101
I have the following setup:
With the following steps leading to my issue:
context.SaveChanges()
is called.The issue is that the EF DB context in the unit test appears to not see the deletion of the claim that the API's DB context made.
Things I have tried:
_host.Services.GetServices<ConfigurationDbContext>().First(service => service.GetType() == typeof(ConfigurationDbContext))
.
context.Entry(resource).Reload()
.Observations:
context.SaveChanges()
call.Questions:
Many thanks in advance.
Upvotes: 6
Views: 3617
Reputation: 101
Thanks to both Eric J and DevilSuichiro for helping me resolve my issue. The problem was that I should not have been trying to use the same DB context. By retrieving a new DB context instead of trying to reuse the same DB context I was able to verify my test results.
Many thanks again.
Upvotes: 4