BanksySan
BanksySan

Reputation: 28560

Remove InternalsVisibleTo for production

Is it possible to disable InternalsVisibleTo for production & acceptance testing?

Whilst I would like to be able to poke internals at design time, I don't really want these exposed at higher level testing.

Upvotes: 9

Views: 505

Answers (1)

Ufuk Hacıoğulları
Ufuk Hacıoğulları

Reputation: 38508

You can add the attribute in a preprocessor directive:

#if(DEBUG)
[assembly:InternalsVisibleTo("SomeAssembly")]
#endif

Upvotes: 9

Related Questions