Any homologue of InternalsVisibleToAttribute, but for internal classes?

Posted by Will Marcouiller on Stack Overflow See other posts from Stack Overflow or by Will Marcouiller
Published on 2010-05-13T14:24:44Z Indexed on 2010/05/13 14:44 UTC
Read the original article Hit count: 257

Filed under:
|
|
|
|

In my most recent question: Unit Testing Best Practice? / C# InternalsVisibleTo() attribute for VBNET 2.0 while testing?, I was asking about InternalsVisibleToAttribute.

I have read the documentation on how to use it, and everything is fine and understood. However, I can't instantiate my class Groupe from my Testing project.

I want to be able to instantiate my internal class in my wrapper assembly, from my testing assembly.

Any help is appreciated!

EDIT

Here's the compile-time error I get when I do try to instantiate my type:

Erreur 2 'Carra.Exemples.Blocs.ActiveDirectory.Groupe' n'est pas accessible dans ce contexte, car il est 'Private'. C:\Open\Projects\Exemples\Src\Carra.Exemples.Blocs.ActiveDirectory\Carra.Exemples.Blocs.ActiveDirectory.Tests\GroupeTests.vb 9 18 Carra.Exemples.Blocs.ActiveDirectory.Tests

(This says that my type is not accessible in this context, because it is private.) But it's Friend (internal)!

© Stack Overflow or respective owner

Related posts about unit-testing

Related posts about internals