title: Testing using reflection (PrivateObject)
body: <p>I have a minor but rather annoying problem.</p>
  
  <p>I am doing some tests using a PrivateObject to access various methods in a class. This all works fine. However when the method signature contains "ref" the ref keyword does not seem to have any effect.</p>
  
  <pre><code>private bool NewDeviceArrivedDeviceAtWorkcenter(ThreadStartArgs args, ref Device deviceAtStation)
  {
  //..SomeCode
       deviceAtStation = null;
  //...Method to test
  }
  </code></pre>
  
  <p>This test is failing..</p>
  
  <pre><code> [TestMethod]
          public void CheckForDeviceAtWorkcenterNoDeviceFound()
          {
  Initialization omitted
  
  var device = new Device();
  
              var result = accessor.Invoke("NewDeviceArrivedDeviceAtWorkcenter", 
                  new []
                      {
                          typeof (ThreadStartArgs), 
                          typeof (Device).MakeByRefType()
                      }, 
                      new object[] 
                      {
                          threadStartArgs, 
                          device
                      });
  
              Assert.IsNull(device);
  }
  </code></pre>
  
  <p>Question: Why is device obj in the test method not set to null?</p>
  
  <p>Any help appreciated</p>
  
  <p>Kind Regards
  Carsten</p>