title: Cannot cast List`1[MyClass]' to type List`1[MyClass_Accessor]'?
body: <p>I got the following error when running the test code. How to workaround the issue? I'm using Visual studio 2010 Premium's built-in MStest.</p>
  
  <pre>
  Test method TestProgram.myProgramTest.GetTypeListTest threw exception: 
  System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[MyProgram.MyClass]' to type 'System.Collections.Generic.List`1[MyProgram.MyClass_Accessor]'.
  </pre>
  
  <p>Method to be tested:</p>
  
  <pre><code>public class MyProjectClass {
      private List&lt;MyClass&gt; GetTypeList()
      { .... 
      }
  }
  
  class MyClass {....} // A POCO class
  </code></pre>
  
  <p>Test code (Most of the code is automatically generated by Visual studio):</p>
  
  <pre><code>[TestMethod()]
  [DeploymentItem("myProgram.exe")]
  public void GetTypeListTest()
  {
      MyProjFile_Accessor target = new MyProjFile_Accessor ();
      var actual = target.GetTypeList();
      Assert.IsTrue(actual.Count &gt; 2);
  }
  </code></pre>
  
  <p><strong>I really don't know why this question has been down voted twice, all other code is either irrelevant to the issue or automatically generated by Visual studio</strong><br>
  It's pretty straight forward class definition. And the test fixture was created using VS 2010 wizard. The method just return <code>MyClass</code> can pass the test. The problem is the method with return type of <code>List&lt;MyClass&gt;</code>.</p>