title: Unit test class with one public and multiple private methods
body: <p>I'm having a little trouble understanding how to approach the following in order to unit test the class.</p>
  
  <p>The object under test is an object that consists out of 1 public method, one that accepts a list of objects of type A and returns an object B (which is a binary stream).
  Due to the nature of the resulting binary stream, which gets large, it is not a nice comparison for the test output.
  The stream is built using several private instance helper methods.</p>
  
  <pre><code>class Foo
  {
      private BinaryStream mBinaryStream;
      public Foo() {}
      public BinaryStream Bar(List&lt;Object&gt; objects) {
          // perform magic to build and return the binary stream;
          // using several private instance helper methods.
          Magic(objects);
          MoreMagic(objects);
      }
      private void Magic(List&lt;Object&gt; objects) { /* work on mBinaryStream */ }
      private void MoreMagic(List&lt;Object&gt; objects) { /* work on mBinaryStream */ }
  };
  </code></pre>
  
  <p>Now I know that I need to test the behaviour of the class, thus the Bar method.
  However, it's undoable (both space and time wise) to do compare the output of the method with a predefined result.
  The number of variations is just too large (and they are corner cases).</p>
  
  <p>One option to go for is to refactor these private helper methods into (a) separate class(es) that can be unit tested. The binary stream can then be chopped into smaller better testable chunks, but also here goes that a lot of cases need to be handled and comparing the binary result will defy the quick time of a unit test. It an option I'd rather not go for.</p>
  
  <p>Another option is to create an interface that defines all these private methods in order to verify (using mocking) if these methods were called or not. This means however that these methods must have public visibility, which is also not nice. And verifying method invocations might be just enough to test for.</p>
  
  <p>Yet another option is to inherit from the class (making the privates protected) and try to test this way.</p>
  
  <p>I have read most of the topics around such issue, but they seem to handle good testable results. This is different than from this challenge.</p>
  
  <p>How would you unit test such class?</p>