This exists (in kind of a hacky way) in C# with the ExternalsVisibleTo attribute. It exposes methods and classes only to specified assemblies (like your unit test assemblies).
https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
<InternalsVisibleTo Include="assemblyname" />
Which means you can do stuff with msbuild props, like auto including a `$(assemblyname).Tests` into your projects.