title: NSubstitute: Checking received methods with array arguments
body: <p>I want to verify that a method on my NSubstitute mock is called with a particular array argument.</p>
  
  <p>Say the interface, <code>IProcessor</code>, has a method <code>void ProcessSomething(Foo[] something])</code>. Say my class under test is named <code>Commander</code>. I set up my test like this:</p>
  
  <pre><code>//prepare
  var processor = Substitute.For&lt;IProcessor&gt;;
  var commander = new Commander(processor);
  var foo1 = new Foo("alpha");
  var foo2 = new Foo("bravo");
  var foos = new [] {foo1, foo2};
  
  //act
  commander.DoSomething(foo1, foo2);
  
  //verify
  processor.Received().ProcessSomething(foos);  // FAILS
  </code></pre>
  
  <p>The <code>Received()</code> call fails with:</p>
  
  <pre><code>NSubstitute.Exceptions.ReceivedCallsException : Expected to receive a call matching:
      ProcessSomething(Foo[])
  Actually received no matching calls.
  Received 1 non-matching call (non-matching arguments indicated with '*' characters):
      ProcessSomething(*Foo[]*)
  </code></pre>
  
  <p>So this looks like ProcessSomething was called with some array other than <code>foos</code>, right?</p>
  
  <p>Well, if I instead test this like, where I capture the argument value using <code>Arg.Do()</code>, it succeeds:</p>
  
  <pre><code>//prepare
  //... as before
  var actualFoos = null;
  
  processor.ProcessSomething(Arg.Do&lt;Foo[]&gt;(x =&gt; actualFoos = x));
  
  //act
  commander.DoSomething(foo1, foo2);
  
  //verify
  Assert.That(actualFoos, Is.EqualTo(foos));   // SUCCEEDS
  </code></pre>
  
  <p>So capturing the argument and comparing it for equality (with NUnit in this example) works, but verifying the received call fails.</p>
  
  <p>Is this a bug in NSubstitute, or am I using it wrong?</p>