title: AutoFixture + NSubstitute throws NotASubstituteException for injected auto mock
body: <p>I'm receiving the following Exception:</p>
  
  <blockquote>
    <p>NSubstitute.Exceptions.NotASubstituteException: NSubstitute extension methods like .Received() can only be called on objects created using Substitute.For() and related methods.</p>
  </blockquote>
  
  <p>...when calling chargeService.When():</p>
  
  <pre><code>public class WhenUserTopsUpAndStripeRejectsPaymentRequest
  {
      [Theory, AutoNSubstituteData]
      public void it_should_throw_AutoTopUpFailedException(
          [Frozen] StripeChargeService chargeService,
          [Frozen] IRepository repository,
          TopUpUserAccountBalance message,
          TopUpUserAccountBalanceHandler sut) &lt;== has dependency on StripeChargeService
      {
          repository.Find(Arg.Any&lt;ById&lt;User&gt;&gt;())
              .Returns(new User
              {
                  AutoTopUpEnabled = true,
                  AccountBalance = -15
              });
  
  =====&gt;  chargeService.When(s =&gt; s.Create(Arg.Any&lt;StripeChargeCreateOptions&gt;()))
              .DoNotCallBase();
  
          Assert.Throws&lt;AutoTopUpFailedException&gt;(() =&gt; sut.Handle(message));
      }
  }
  </code></pre>
  
  <p>Now, I can of course get around this by doing as the Exception suggests and manually create the StripeChargeService, and then manually create and inject all my dependencies into my SUT, but I'd rather have less code and let AutoFixture do the work.</p>
  
  <pre><code>public class AndStripeRejectsPaymentRequest
  {
      [Theory, AutoNSubstituteData]
      public void it_should_throw_AutoTopUpFailedException(
          IMediator mediator,
          IBillingConfig config,
          [Frozen] IRepository repository,
          TopUpDriverAccountBalance message)
      {
          var chargeService = Substitute.ForPartsOf&lt;StripeChargeService&gt;("");
  
          repository.Find(Arg.Any&lt;ById&lt;Driver, TopUpDriverAccountBalanceHandler.DriverProjection&gt;&gt;())
              .Returns(new TopUpDriverAccountBalanceHandler.DriverProjection
              {
                  AutoTopUpEnabled = true,
                  AccountBalance = -15
              });
  
          chargeService.When(s =&gt; s.Create(Arg.Any&lt;StripeChargeCreateOptions&gt;()))
              .DoNotCallBase();
  
          // Manually build SUT, with params declared above.
          var sut = new TopUpDriverAccountBalanceHandler(mediator, repository, config, chargeService);
  
          Assert.Throws&lt;AutoTopUpFailedException&gt;(() =&gt; sut.Handle(message));
      }
  }
  </code></pre>
  
  <p>I thought that by using the <code>AutoNSubstituteCustomization()</code> in the AutoFixture.AutoNSubstitute NuGet package, auto-mocked parameters <em>would</em> be created using NSubstitute. What am I doing wrong?</p>