I am aware that such question has already been asked, but solution did not help me.
[Fact]
public async Task UpdateAsync()
{
string newTitle = \"newTitle1\";
I was getting the same problem when was trying to update the value. then i found the proble i was using this.
services.AddDbContext(option => option.UseSqlServer(Configuration.GetConnectionString("databasename")),ServiceLifetime.Singleton);
then i remove lifetime and it worked well for me.
services.AddDbContext(option => option.UseSqlServer(Configuration.GetConnectionString("databasename")));