title: Unit test throws ArgumentOutOfRange from private accessor
body: <p>I have a VS-generated private accessor on my unit test project. In the test I've defined an ExpectedException attribute, and my method under test throws this. However, then the unit test throws ArgumentOutOfRangeException (parameter name: index), and my test fails. I've no idea why this happens.</p>
  
  <pre><code>at Microsoft.VisualStudio.TestTools.UnitTesting.Helper.ThrowInnerException(TargetInvocationException outer)
  at Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject.Invoke(String name, BindingFlags bindingFlags, Type[] parameterTypes, Object[] args, CultureInfo culture, Type[] typeArguments)
  at Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject.Invoke(String name, Type[] parameterTypes, Object[] args)
  at MyProject.MyType_Accessor.Foo()
  at MyUnitTests.MyTypeTests.TestFoo() in c:\...\ MyTypeTests.cs:line 513
  </code></pre>
  
  <p>Edit</p>
  
  <pre><code>public class MyType
  {
      private void Foo()
      {
           ...
  
          if (DateTime.Now &lt; _date)
          {
              throw new ValidationException();
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>[TestClass]
  public class MyTypeTests
  {
      [TestMethod]
      [ExpectedException(typeof(ValidationException))]
      public void TestFoo()
      {
          MyType_Accessor mytype = new MyType_Accessor();
          mytype.Foo();   // This is line 513.
      }
  }
  </code></pre>