In my case i just changed
_userManager.Setup(r => r.GetRolesAsync(newlyCreatedUser)).ReturnsAsync(x => oldRolesThatUserHad);
into
_userManager.Setup(r => r.GetRolesAsync(newlyCreatedUser)).ReturnsAsync(oldRolesThatUserHad); //omit the lambda