title: How to handle delegate parameter in NSubstitute
body: <p>I have a class with a method that has a signature like this:</p>
  
  <pre><code>public async Task&lt;ResponseType&gt; getSuff(string id, 
                                          string moreInfo, 
                                          deletegateName doStuff
                                         ) { // details. }
  </code></pre>
  
  <p>I am trying to mock this call with NSubstitute like this:</p>
  
  <pre><code>MyClass helper = Substitute.ForPartsOf&lt;MyClass&gt;();
  ResponseType response = new ResponseType();
  helper.getSuff(Arg.Any&lt;string&gt;(), 
                 Arg.Any&lt;string&gt;(),
                 Arg.Any&lt;DelegateDefn&gt;()).Returns(Task.FromResult(response));
  </code></pre>
  
  <p>But I am getting a runtime error:</p>
  
  <blockquote>
    <p>NSubstitute.Exceptions.CouldNotSetReturnDueToNoLastCallException:
    Could not find a call to return from.</p>
    
    <p>Make sure you called Returns() after calling your substitute (for
    example: mySub.SomeMethod().Returns(value)), and that you are not
    configuring other substitutes within Returns() (for example, avoid
    this: mySub.SomeMethod().Returns(ConfigOtherSub())).</p>
    
    <p>If you substituted for a class rather than an interface, check that
    the call to your substitute was on a virtual/abstract member. Return
    values cannot be configured for non-virtual/non-abstract members.</p>
    
    <p>Correct use:  mySub.SomeMethod().Returns(returnValue);</p>
    
    <p>Potentially problematic use:
      mySub.SomeMethod().Returns(ConfigOtherSub()); Instead try:  var
    returnValue = ConfigOtherSub();
      mySub.SomeMethod().Returns(returnValue);</p>
  </blockquote>
  
  <p>The problem is, I think, the delegate. I just want to mock out the method, I do not want the delegate actually passed to be executed.</p>
  
  <p>So, does anyone know how I can achieve this?
  Thanks.</p>