Fortunately there is a way to this!
It is very well documented in the links below:
http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx
http://devlicio.us/blogs/derik_whittaker/archive/2007/04/09/internalsvisibleto-testing-internal-methods-in-net-2-0.aspx
Just a note: make sure you use internal, and not private access modifiers, and also, if your assembly name and namespace are different - make sure use Assembly Name in
[assembly: InternalsVisibleTo("XXXTests")]
You can find the Assembly Name in the project properties, Application tab.
No comments:
Post a Comment