title: How to write C# test cases for private functions with "out" parameters?
body: <p>How do I create unit tests for out parameters of a private function?</p>
  
  <p>My service layer:</p>
  
  <pre><code>private int LoadProduct(string productId, out IProduct product)
  {
      product = this.Load(productId);
  
      return ErrorCodes.Success;
  }
  </code></pre>
  
  <p>Test case:</p>
  
  <pre><code>[Test]
  public void LoadProductTest()
  {
      var offerService = new OfferProcessor();
      var privateOfferService = new PrivateObject(offerService);
  
      IProduct myProduct = null;
  
      var result = (int)privateOfferService.Invoke("LoadProduct", 
                         new object[] {"AnId", myProduct });
  
      Assert.That(result, Is.EqualTo(ErrorCodes.Success));
      Assert.That(myProduct, Is.NotNull());
  }
  </code></pre>
  
  <p>The above test case does not compile. How do I pass Invoke an out parameter and then access it after the call?</p>