title: Should I be accessing protected methods for unit tests?
body: <p>In relation to <a href="https://stackoverflow.com/questions/15197141/how-to-properly-test-an-abstract-class">this question</a> I asked earlier, I am stuck yet again with my unit test.</p>
  
  <p>My current problem is in relation to testing the <code>protected</code> methods of my abstract <code>Component</code> class.</p>
  
  <p>I've successfully implemented a mock class, named <code>ConcreteComponent</code>, which does its job very well of inheriting everything the abstract class has.</p>
  
  <p>Thing is, I made this concrete class inside my unit test file. The only way of testing protected methods is to have a Private Accessor. However, I cannot create a Private Accessor inside the same file as where the unit test is, and thus, cannot access the protected methods.</p>
  
  <p>I've tried to place the mock concrete class in a separate file, under a different namespace, and this now allows me to create a Private Accessor to which the unit test file can now use. It worked nicely, but then I figured I need this mock concrete class inside the same file where the unit test is.</p>
  
  <p>So now I have two questions:</p>
  
  <p>1) What are the possible workarounds for this problem?</p>
  
  <p>2) Why can't I create a private accessor for a mock class which is inside the same file and namespace as the unit test class?</p>