Being a purist, I like to lock down my classes and methods with private and internal so as not to expose functionality unnecessarily as public. This presents a problem with unit testing. The test harness cannot see internal methods...even on a public class. I had been editing the code to mark the method public, executing tests in debug mode, and then re-editing the method back to internal. Hokey...at best. As a far more optimal and usable alternative, add an InternalsVisibleTo directive to your AssemblyInfo.cs file. It opens the door to test harnesses to internal methods. [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("[Namespace of test harness here without brackets]")]
Business and technology musings with an occasional economic, political, or consumer experience teaser thrown in to keep you on your toes.