Is it considered bad practice to use InternalsVisibleTo for Unit Test Code?

后端 未结 6 1218
余生分开走
余生分开走 2021-01-03 19:39

Sample code in framework\'s AssemblyInfo.cs:

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo
                          (\"Test.Com         


        
6条回答
  •  再見小時候
    2021-01-03 20:15

    No, it is not considered bad practice. There is no other way, if the classes you want to test are internal to your assembly for good reasons. Just not testing them would be a lot worse.

提交回复
热议问题