title: Unit testing error System.InvalidCastException:
body: <p>I'm testing a method that calls a function from my repository and returns it as a list but I keep getting this error:</p>
  <blockquote>
  <p>System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[System.String]' to type 'System.String[]'.</p>
  </blockquote>
  <p>I don't know what I'm missing. Here's the method:</p>
  <pre><code>public IList&lt;TransactionStatus&gt; GetBookingStatuses(IList&lt;string&gt; uniqueTransactionRefs)
  {
      TransactionStatus[] transactionStatuses = DBRepository.GetStatuses((string[])uniqueTransactionRefs);
      return transactionStatuses;
  }
  </code></pre>
  <p>And this is the method <code>GetStatuses</code> in my repository:</p>
  <pre><code>TransactionStatus[] GetStatuses(string[] uniqueTransactionRefs);
  </code></pre>