I admit that I am a complete beginner when it comes to unit testing. I can easily understand the concepts (check one thing, break-fix-test-repeat, etc.), but I had a little problem with this ...
I was instructed to rewrite most of our application, and my cool structure is pretty good. We have our test projects mixed with the rest of the solution, and all links are built in the way we want. Unfortunately, there are several Friends classes that can only be accessed from the same namespace. Be that as it may, the test class is not a member of this namespace, so I cannot directly access any of these base methods that need to be tested REALLY .
From what I read, I could create a public layout of the classes in question and test it this way, but I am worried that someone will make changes to the production code along the way and not copy it to the test code, completely surpassing the purpose of testing. Another option would be to change the access level on the classes themselves, but this will require a lot of overhead and mess with the existing code. The idea to write an interface also came up, but the creation of a solid interface structure for testing did not come under control.
Am I just missing something? What would be the best way to ensure that these base classes actually function correctly without changing access to them?
source share