title: How to unit test a spreadsheet parser?
body: <p>I have a <code>DeliveryScheduleParser</code> class that reads in a spreadsheet and parses it into a number of objects that all end up in a client object that is returned by the <code>getClient()</code> method in the <code>DeliveryScheduleParser</code> class.</p>
  
  <pre><code>public class DeliveryScheduleParser {
  
      private final HashMap&lt;String, Integer&gt; _headerColumnNumbers;
      private final File _file;
      private HSSFSheet sheet;
      private Client client;
  
      public DeliveryScheduleParser(File file) {
          this._file = file;
          sheet = getSheet(_file);
          _headerColumnNumbers = getHeaderMap(sheet);
          parseSheet();
      }
  
      public Client getClient(){
          return client;
      }
  
      // Other private methods here
  }
  </code></pre>
  
  <p>The <code>parseSheet()</code> method inside this class basically does all the work and only calls some static <em>Sanitizer</em> methods that are separately unit tested.</p>
  
  <p>My question is basically what would be the best way to make sure that the client object is properly filled with the right objects, and that those objects are in turn also filled with the right objects (there are a lot of <code>ArrayLists</code> nested within other <code>ArrayLists</code>).</p>
  
  <p>I'd also like to run the unit test against spreadsheets with different data to ensure that all the parsing is correct.</p>