For me, adding something like this in your project's .csproj file worked:
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>WhateverFileName.Tests, PublicKey=213456789</_Parameter1>
</AssemblyAttribute>
</ItemGroup>