title: unit-testing abstract classes and protected methods inside them
body: <p>how can I test abstract classes and protected methods inside them? I know some of you will suggest that I shouldn't test the abstract class, but rather test the classes that derive from it instead. Thing is, I don't want to do that. I want to strictly test the abstract class itself. Here is the sample class:</p>
  
  <pre><code>public interface IF_SystemMessageHandler
  {
      ...
  }
  
  public interface IF_SystemMessageSender
  {
      ...
  }
  
      public abstract class Component : IF_SystemMessageSender
      {
  
          private eVtCompId mComponentId;
          private eLayer mLayerId;
          private IF_SystemMessageHandler mLogger;
  
          protected Component(eVtCompId inComponentId, eLayer inLayerId, IF_SystemMessageHandler inMessageHandler)
          {
              mLayerId = inLayerId;
              mComponentId = inComponentId;
              mLogger = inMessageHandler;
          }
  
          protected void SendSystemMessage(ref eSystemMsgLevel inSystemMsgLevel, ref string inSysMsg)
          {
              mLogger.SendSystemMessage(...);
          }
  
          protected void SendSystemMessage(ref eSystemMsgLevel inSystemMsgLevel, ref eTextId inSysMsgID)
          {
              mLogger.SendSystemMessage(...);
          }
  
          public void SetMessageHandler(ref IF_SystemMessageHandler InSystemMessageHandler)
          {
              mLogger = InSystemMessageHandler;
          }
  
      }
  </code></pre>
  
  <p>I'm writing a unit test for it. I know that one of the things I can do is utilize a unit-testing framework (I have Moq), but I have no idea on how to use it for this particular instance. </p>