xUnit theory test using generics
问题 In xUnit I can have a Theory test that uses generics in this form: [Theory] [MemberData(SomeScenario)] public void TestMethod<T>(T myType) { Assert.Equal(typeof(double), typeof(T)); } public static IEnumerable<object[]> SomeScenario() { yield return new object[] { 1.23D }; } Which will give me the generic T parameter as double . Is it possible to use MemberData to specify the generic type parameter for a test with a signature like: [Theory] [MemberData(SomeTypeScenario)] public void