title: xUnit theory test using generics
body: <p>In xUnit I can have a <code>Theory</code> test that uses generics in this form:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[Theory]
  [MemberData(SomeScenario)]
  public void TestMethod&lt;T&gt;(T myType)
  {
      Assert.Equal(typeof(double), typeof(T));
  }
  
  public static IEnumerable&lt;object[]&gt; SomeScenario()
  {
      yield return new object[] { 1.23D };
  }
  </code></pre>
  
  <p>Which will give me the generic <code>T</code> parameter as <code>double</code>. Is it possible to use <code>MemberData</code> to specify the generic type parameter for a test with a signature like:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[Theory]
  [MemberData(SomeTypeScenario)]
  public void TestMethod&lt;T&gt;()
  {
      Assert.Equal(typeof(double), typeof(T));
  }
  </code></pre>
  
  <p>If it is not possible with <code>MemberData</code> or any other provided attribute (which I'm suspecting that it isn't), is it possible to create an attribute for Xunit that can achieve this? Maybe something along the lines of specifying Types in the Scenarios method and using reflection in a similar manner to Jon Skeet's answer here: <a href="https://stackoverflow.com/a/2107864/1926027">Generics in C#, using type of a variable as parameter</a></p>