diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodWithDataSourceTests.Generic_Method_With_MethodDataSource_Should_Generate_Tests.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodWithDataSourceTests.Generic_Method_With_MethodDataSource_Should_Generate_Tests.verified.txt
new file mode 100644
index 0000000000..d41e5d35c6
--- /dev/null
+++ b/TUnit.Core.SourceGenerator.Tests/GenericMethodWithDataSourceTests.Generic_Method_With_MethodDataSource_Should_Generate_Tests.verified.txt
@@ -0,0 +1,3257 @@
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "Should_Create_Instance",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TestMethodName = "Should_Create_Instance",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 35,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Create_Instance",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassNoDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ var genericType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>);
+ if (typeArgs.Length > 0)
+ {
+ var closedType = genericType.MakeGenericType(typeArgs);
+ return global::System.Activator.CreateInstance(closedType, args)!;
+ }
+ throw new global::System.InvalidOperationException("No type arguments provided for generic class");
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Create_Instance",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource),
+ TestMethodName = "Should_Create_Instance",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 35,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Create_Instance",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassNoDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.Should_Create_Instance());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeB).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeB).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Create_Instance",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource),
+ TestMethodName = "Should_Create_Instance",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 35,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Create_Instance",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassNoDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.Should_Create_Instance());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ }
+ };
+ genericMetadata.TestSessionId = testSessionId;
+ yield return genericMetadata;
+ yield break;
+ }
+ public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ {
+ yield return new global::TUnit.Core.TestDescriptor
+ {
+ TestId = "TUnit.TestProject.Bugs._4431.GenericClassNoDataSource.Should_Create_Instance",
+ ClassName = "GenericClassNoDataSource",
+ MethodName = "Should_Create_Instance",
+ FullyQualifiedName = "TUnit.TestProject.Bugs._4431.GenericClassNoDataSource.Should_Create_Instance",
+ FilePath = @"",
+ LineNumber = 35,
+ Categories = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ HasDataSource = false,
+ RepeatCount = 0,
+ DependsOn = global::System.Array.Empty(),
+ Materializer = GetTestsAsync
+ };
+ }
+}
+internal static class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_ModuleInitializer
+{
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ public static void Initialize()
+ {
+ global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_TestSource());
+ }
+}
+
+
+// ===== FILE SEPARATOR =====
+
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "Should_Have_Number",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TestMethodName = "Should_Have_Number",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 59,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Number",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(int))
+ {
+ Name = "number",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(int)),
+ IsNullable = false,
+ ReflectionInfo = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>).GetMethod("Should_Have_Number", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int) }, null)!.GetParameters()[0]
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassWithMethodDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ var genericType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>);
+ if (typeArgs.Length > 0)
+ {
+ var closedType = genericType.MakeGenericType(typeArgs);
+ return global::System.Activator.CreateInstance(closedType, args)!;
+ }
+ throw new global::System.InvalidOperationException("No type arguments provided for generic class");
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Have_Number",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource),
+ TestMethodName = "Should_Have_Number",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.MethodDataSourceAttribute("GetNumbers"),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = new global::TUnit.Core.IDataSourceAttribute[]
+ {
+ new global::TUnit.Core.MethodDataSourceAttribute("GetNumbers")
+ {
+ Factory = (dataGeneratorMetadata) =>
+ {
+ async global::System.Collections.Generic.IAsyncEnumerable>> Factory()
+ {
+ var result = global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource.GetNumbers();
+ if (result is global::System.Collections.IEnumerable enumerable && !(result is string))
+ {
+ foreach (var item in enumerable)
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(item));
+ }
+ }
+ else
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(result));
+ }
+ }
+ return Factory();
+ }
+ },
+ },
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 59,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Number",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(int))
+ {
+ Name = "number",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(int)),
+ IsNullable = false,
+ ReflectionInfo = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>).GetMethod("Should_Have_Number", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int) }, null)!.GetParameters()[0]
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassWithMethodDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.Should_Have_Number((int)args[0]!));
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeB).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeB).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Have_Number",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource),
+ TestMethodName = "Should_Have_Number",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.MethodDataSourceAttribute("GetNumbers"),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = new global::TUnit.Core.IDataSourceAttribute[]
+ {
+ new global::TUnit.Core.MethodDataSourceAttribute("GetNumbers")
+ {
+ Factory = (dataGeneratorMetadata) =>
+ {
+ async global::System.Collections.Generic.IAsyncEnumerable>> Factory()
+ {
+ var result = global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource.GetNumbers();
+ if (result is global::System.Collections.IEnumerable enumerable && !(result is string))
+ {
+ foreach (var item in enumerable)
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(item));
+ }
+ }
+ else
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(result));
+ }
+ }
+ return Factory();
+ }
+ },
+ },
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 59,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Number",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(int))
+ {
+ Name = "number",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(int)),
+ IsNullable = false,
+ ReflectionInfo = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>).GetMethod("Should_Have_Number", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int) }, null)!.GetParameters()[0]
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassWithMethodDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.Should_Have_Number((int)args[0]!));
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ }
+ };
+ genericMetadata.TestSessionId = testSessionId;
+ yield return genericMetadata;
+ yield break;
+ }
+ public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ {
+ yield return new global::TUnit.Core.TestDescriptor
+ {
+ TestId = "TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource.Should_Have_Number",
+ ClassName = "GenericClassWithMethodDataSource",
+ MethodName = "Should_Have_Number",
+ FullyQualifiedName = "TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource.Should_Have_Number",
+ FilePath = @"",
+ LineNumber = 59,
+ Categories = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ HasDataSource = true,
+ RepeatCount = 0,
+ DependsOn = global::System.Array.Empty(),
+ Materializer = GetTestsAsync
+ };
+ }
+}
+internal static class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_ModuleInitializer
+{
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ public static void Initialize()
+ {
+ global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_TestSource());
+ }
+}
+
+
+// ===== FILE SEPARATOR =====
+
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "GenericMethod_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TestMethodName = "GenericMethod_Should_Work",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 74,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "GenericMethod_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "NonGenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod();
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(int).FullName ?? typeof(int).Name)] =
+ new global::TUnit.Core.TestMetadata
+ {
+ TestName = "GenericMethod_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TestMethodName = "GenericMethod_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(int)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 74,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "GenericMethod_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "NonGenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.GenericMethod_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(string).FullName ?? typeof(string).Name)] =
+ new global::TUnit.Core.TestMetadata
+ {
+ TestName = "GenericMethod_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TestMethodName = "GenericMethod_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(string)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 74,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "GenericMethod_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "NonGenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.GenericMethod_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name)] =
+ new global::TUnit.Core.TestMetadata
+ {
+ TestName = "GenericMethod_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TestMethodName = "GenericMethod_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(global::TUnit.TestProject.Bugs._4431.TypeA)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 74,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "GenericMethod_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)),
+ Name = "NonGenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.GenericMethod_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ }
+ };
+ genericMetadata.TestSessionId = testSessionId;
+ yield return genericMetadata;
+ yield break;
+ }
+ public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ {
+ yield return new global::TUnit.Core.TestDescriptor
+ {
+ TestId = "TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod.GenericMethod_Should_Work",
+ ClassName = "NonGenericClassWithGenericMethod",
+ MethodName = "GenericMethod_Should_Work",
+ FullyQualifiedName = "TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod.GenericMethod_Should_Work",
+ FilePath = @"",
+ LineNumber = 74,
+ Categories = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ HasDataSource = false,
+ RepeatCount = 0,
+ DependsOn = global::System.Array.Empty(),
+ Materializer = GetTestsAsync
+ };
+ }
+}
+internal static class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_ModuleInitializer
+{
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ public static void Initialize()
+ {
+ global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_TestSource());
+ }
+}
+
+
+// ===== FILE SEPARATOR =====
+
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMethod_With_DataSource__string_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "GenericMethod_With_DataSource",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TestMethodName = "GenericMethod_With_DataSource",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(double))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 97,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "GenericMethod_With_DataSource",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(string))
+ {
+ Name = "input",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(string)),
+ IsNullable = false,
+ ReflectionInfo = global::System.Linq.Enumerable.FirstOrDefault(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance | global::System.Reflection.BindingFlags.Static), m => m.Name == "GenericMethod_With_DataSource" && m.GetParameters().Length == 1)?.GetParameters()[0]!
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "NonGenericClassWithGenericMethodAndDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource();
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(int).FullName ?? typeof(int).Name)] =
+ new global::TUnit.Core.TestMetadata
+ {
+ TestName = "GenericMethod_With_DataSource",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TestMethodName = "GenericMethod_With_DataSource",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(int)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(double)),
+ new global::TUnit.Core.MethodDataSourceAttribute("GetStrings")
+ ],
+ DataSources = new global::TUnit.Core.IDataSourceAttribute[]
+ {
+ new global::TUnit.Core.MethodDataSourceAttribute("GetStrings")
+ {
+ Factory = (dataGeneratorMetadata) =>
+ {
+ async global::System.Collections.Generic.IAsyncEnumerable>> Factory()
+ {
+ var result = global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource.GetStrings();
+ if (result is global::System.Collections.IEnumerable enumerable && !(result is string))
+ {
+ foreach (var item in enumerable)
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(item));
+ }
+ }
+ else
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(result));
+ }
+ }
+ return Factory();
+ }
+ },
+ },
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 97,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "GenericMethod_With_DataSource",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(string))
+ {
+ Name = "input",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(string)),
+ IsNullable = false,
+ ReflectionInfo = global::System.Linq.Enumerable.FirstOrDefault(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance | global::System.Reflection.BindingFlags.Static), m => m.Name == "GenericMethod_With_DataSource" && m.GetParameters().Length == 1)?.GetParameters()[0]!
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "NonGenericClassWithGenericMethodAndDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.GenericMethod_With_DataSource((string)args[0]!));
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(double).FullName ?? typeof(double).Name)] =
+ new global::TUnit.Core.TestMetadata
+ {
+ TestName = "GenericMethod_With_DataSource",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TestMethodName = "GenericMethod_With_DataSource",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(double)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(double)),
+ new global::TUnit.Core.MethodDataSourceAttribute("GetStrings")
+ ],
+ DataSources = new global::TUnit.Core.IDataSourceAttribute[]
+ {
+ new global::TUnit.Core.MethodDataSourceAttribute("GetStrings")
+ {
+ Factory = (dataGeneratorMetadata) =>
+ {
+ async global::System.Collections.Generic.IAsyncEnumerable>> Factory()
+ {
+ var result = global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource.GetStrings();
+ if (result is global::System.Collections.IEnumerable enumerable && !(result is string))
+ {
+ foreach (var item in enumerable)
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(item));
+ }
+ }
+ else
+ {
+ yield return () => global::System.Threading.Tasks.Task.FromResult(global::TUnit.Core.Helpers.DataSourceHelpers.ToObjectArray(result));
+ }
+ }
+ return Factory();
+ }
+ },
+ },
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 97,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "GenericMethod_With_DataSource",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ new global::TUnit.Core.ParameterMetadata(typeof(string))
+ {
+ Name = "input",
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(string)),
+ IsNullable = false,
+ ReflectionInfo = global::System.Linq.Enumerable.FirstOrDefault(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance | global::System.Reflection.BindingFlags.Static), m => m.Name == "GenericMethod_With_DataSource" && m.GetParameters().Length == 1)?.GetParameters()[0]!
+ }
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)),
+ Name = "NonGenericClassWithGenericMethodAndDataSource",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.GenericMethod_With_DataSource((string)args[0]!));
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ }
+ };
+ genericMetadata.TestSessionId = testSessionId;
+ yield return genericMetadata;
+ yield break;
+ }
+ public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ {
+ yield return new global::TUnit.Core.TestDescriptor
+ {
+ TestId = "TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource.GenericMethod_With_DataSource",
+ ClassName = "NonGenericClassWithGenericMethodAndDataSource",
+ MethodName = "GenericMethod_With_DataSource",
+ FullyQualifiedName = "TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource.GenericMethod_With_DataSource",
+ FilePath = @"",
+ LineNumber = 97,
+ Categories = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ HasDataSource = true,
+ RepeatCount = 0,
+ DependsOn = global::System.Array.Empty(),
+ Materializer = GetTestsAsync
+ };
+ }
+}
+internal static class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMethod_With_DataSource__string_ModuleInitializer
+{
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ public static void Initialize()
+ {
+ global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMethod_With_DataSource__string_TestSource());
+ }
+}
+
+
+// ===== FILE SEPARATOR =====
+
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "BothGeneric_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TestMethodName = "BothGeneric_Should_Work",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 117,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "BothGeneric_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "GenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ var genericType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>);
+ if (typeArgs.Length > 0)
+ {
+ var closedType = genericType.MakeGenericType(typeArgs);
+ return global::System.Activator.CreateInstance(closedType, args)!;
+ }
+ throw new global::System.InvalidOperationException("No type arguments provided for generic class");
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name) + "," + (typeof(int).FullName ?? typeof(int).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "BothGeneric_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod),
+ TestMethodName = "BothGeneric_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(int)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 117,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "BothGeneric_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "GenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.BothGeneric_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name) + "," + (typeof(string).FullName ?? typeof(string).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "BothGeneric_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod),
+ TestMethodName = "BothGeneric_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(string)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 117,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "BothGeneric_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "GenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.BothGeneric_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeB).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeB).Name) + "," + (typeof(int).FullName ?? typeof(int).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "BothGeneric_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod),
+ TestMethodName = "BothGeneric_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(int)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 117,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "BothGeneric_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "GenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.BothGeneric_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeB).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeB).Name) + "," + (typeof(string).FullName ?? typeof(string).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "BothGeneric_Should_Work",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod),
+ TestMethodName = "BothGeneric_Should_Work",
+ GenericMethodTypeArguments = new global::System.Type[] { typeof(string)},
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(int)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(string)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 117,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "BothGeneric_Should_Work",
+ GenericTypeCount = 1,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), [new global::TUnit.Core.GenericParameter(0, false, "TClass")]),
+ Name = "GenericClassWithGenericMethod",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.BothGeneric_Should_Work());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ }
+ };
+ genericMetadata.TestSessionId = testSessionId;
+ yield return genericMetadata;
+ yield break;
+ }
+ public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ {
+ yield return new global::TUnit.Core.TestDescriptor
+ {
+ TestId = "TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod.BothGeneric_Should_Work",
+ ClassName = "GenericClassWithGenericMethod",
+ MethodName = "BothGeneric_Should_Work",
+ FullyQualifiedName = "TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod.BothGeneric_Should_Work",
+ FilePath = @"",
+ LineNumber = 117,
+ Categories = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ HasDataSource = false,
+ RepeatCount = 0,
+ DependsOn = global::System.Array.Empty(),
+ Materializer = GetTestsAsync
+ };
+ }
+}
+internal static class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_ModuleInitializer
+{
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ public static void Initialize()
+ {
+ global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), new TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_TestSource());
+ }
+}
+
+
+// ===== FILE SEPARATOR =====
+
+//
+#pragma warning disable
+
+#nullable enable
+namespace TUnit.Generated;
+internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T_Should_Have_Label_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+{
+ public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ // Create generic metadata with concrete type registrations
+ var genericMetadata = new global::TUnit.Core.GenericTestMetadata
+ {
+ TestName = "Should_Have_Label",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TestMethodName = "Should_Have_Label",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ InheritanceDepth = 0,
+ FilePath = @"",
+ LineNumber = 144,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Label",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassWithConstructor",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ var genericType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>);
+ if (typeArgs.Length > 0)
+ {
+ var closedType = genericType.MakeGenericType(typeArgs);
+ return global::System.Activator.CreateInstance(closedType, args)!;
+ }
+ throw new global::System.InvalidOperationException("No type arguments provided for generic class");
+ },
+ ConcreteInstantiations = new global::System.Collections.Generic.Dictionary
+ {
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeA).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeA).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Have_Label",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor),
+ TestMethodName = "Should_Have_Label",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 144,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Label",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty(),
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>", static () =>
+ {
+ var classMetadata = new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "GenericClassWithConstructor",
+ Namespace = "TUnit.TestProject.Bugs._4431",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", static () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ };
+ return classMetadata;
+ })
+ },
+ InstanceFactory = static (typeArgs, args) =>
+ {
+ return new global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor();
+ },
+ InvokeTypedTest = static (instance, args, cancellationToken) =>
+ {
+ try
+ {
+ var typedInstance = (global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor)instance;
+ return global::TUnit.Core.AsyncConvert.Convert(() => typedInstance.Should_Have_Label());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ }
+ ,
+ [(typeof(global::TUnit.TestProject.Bugs._4431.TypeB).FullName ?? typeof(global::TUnit.TestProject.Bugs._4431.TypeB).Name)] =
+ new global::TUnit.Core.TestMetadata>
+ {
+ TestName = "Should_Have_Label",
+ TestClassType = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor),
+ TestMethodName = "Should_Have_Label",
+ Dependencies = global::System.Array.Empty(),
+ AttributeFactory = static () =>
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeA)),
+ new global::TUnit.Core.GenerateGenericTestAttribute(typeof(global::TUnit.TestProject.Bugs._4431.TypeB))
+ ],
+ DataSources = global::System.Array.Empty(),
+ ClassDataSources = global::System.Array.Empty(),
+ PropertyDataSources = global::System.Array.Empty(),
+ PropertyInjections = global::System.Array.Empty(),
+ FilePath = @"",
+ LineNumber = 144,
+ InheritanceDepth = 0,
+ TestSessionId = testSessionId,
+ MethodMetadata = new global::TUnit.Core.MethodMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>),
+ TypeInfo = new global::TUnit.Core.ConstructedGeneric(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), [new global::TUnit.Core.GenericParameter(0, false, "T")]),
+ Name = "Should_Have_Label",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = global::System.Array.Empty