Hi Craig. Yes, that's the whole point. How do we compromise between access modifiers and unit testability? I'm also finding that developers who practice true TDD are more likely to be lenient with access modifiers. I'd be interested in hearing from such developers.
Thanks jmeckley for your reply. I agree regarding non-public constructors, particularly where a factory is the intended means of producing an object. I also agree with revealing interfaces in a common top-level namespace. I've heard that this is particularly common in the Java community, and...
I often find what I believe are good cases for using the "internal" access modifier on certain class members in C# for code readability and to prevent unintended usage. In .NET we usually write our unit tests in a separate unit test project. Problem is, class members marked as internal are not...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.