UnitTestBoilerplateGenerator
UnitTestBoilerplateGenerator copied to clipboard
Feature Request: add InternalsVisibleTo when creating tests for internal classes
Description
When adding a unit test for a class that is protected, its required to add the "InternalsVisibleTo" to the origin (either as attribute in the file or in the project file (https://www.meziantou.net/declaring-internalsvisibleto-in-the-csproj.htm)
Would be nice to have it detect that the origin class is protected and InternalsVisibleTo is required and then adds it according to the configured prefered method.
It looks like from that article you can set it up for the whole project to expose its internals to test assemblies. It doesn't seem to be in the scope of the project; which is creating boilerplate test code targeting a given file. It looks like there are different strategies to expose test internals as well. I could see this being a separate extension if you'd like to try to automate it.
For a bit more context, UTBG currently does not edit .csproj properties at all, except for just adding the file to the test .csproj.