c# - Restrict visibility of classes by specific assembly -


i working on application includes communication module uses tcp server , tcp client. communication module includes directory "core" contains private classes internal functioning of communication module.

my goal create unit tests classes in "core" directory. but, not accessible test project.

is there method, or design pattern allow me prevent use of these classes outside assembly, except test assembly?

thank you,

you can make internal classes available yourtestproject adding line:

[assembly: internalsvisibleto("yourtestproject")] 

in assemblyinfo.cs of project want test.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -