title: IoC & Interfaces Best Practices
body: <p>I'm experimenting with IoC on my way to TDD by fiddling with an existing project. In a nutshell, my question is this: what are the best practices around IoC when public and non-public methods are of interest?</p>
  
  <p>There are two classes:</p>
  
  <pre><code>public abstract class ThisThingBase
  {
      public virtual void Method1() {}
      public virtual void Method2() {}
  
      public ThatThing GetThat()
      {
          return new ThatThing(this);
      }
      internal virtual void Method3() {}
      internal virtual void Method4() {}
  }
  
  public class Thathing
  {
      public ThatThing(ThisThingBase thing)
      {
          m_thing = thing;
      }
      ...
  }
  </code></pre>
  
  <p>ThatThing does some stuff using its ThisThingBase reference to call methods that are often overloaded by descendents of ThisThingBase.</p>
  
  <p>Method1 and Method2 are public. Method3 and Method4 are internal and only used by ThatThings.</p>
  
  <p>I would like to test ThatThing without ThisThing and vice-versa.</p>
  
  <p>Studying up on IoC my first thought was that I should define an IThing interface, implement it by ThisThingBase and pass it to the ThatThing constructor. IThing would be the public interface clients could call but it doesn't include Method3 or Method4 that ThatThing also needs.</p>
  
  <p>Should I define a 2nd interface - IThingInternal maybe - for those two methods and pass BOTH interfaces to ThatThing?</p>