diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
index a233745939..40b8e51e1c 100644
--- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
@@ -1,61 +1,52 @@
-//
+//
#pragma warning disable
#nullable enable
namespace TUnit.Generated;
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
-internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource
{
- public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass1", new global::TUnit.Core.ClassMetadata
{
- var metadata = new global::TUnit.Core.TestMetadata
+ Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1)),
+ Name = "ConcreteClass1",
+ Namespace = "TUnit.TestProject.AbstractTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("AssertClassName", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static global::TUnit.TestProject.AbstractTests.ConcreteClass1 __CreateInstance_0(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.AbstractTests.ConcreteClass1();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke_0(global::TUnit.TestProject.AbstractTests.ConcreteClass1 instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ try
{
- TestName = "AssertClassName",
- TestClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
- TestMethodName = "AssertClassName",
- Dependencies = global::System.Array.Empty(),
- AttributeFactory = __CreateAttributes,
- DataSources = global::System.Array.Empty(),
- ClassDataSources = global::System.Array.Empty(),
- PropertyDataSources = global::System.Array.Empty(),
- PropertyInjections = global::System.Array.Empty(),
- InheritanceDepth = 1,
- FilePath = @"",
- LineNumber = 3,
- MethodMetadata = new global::TUnit.Core.MethodMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass)),
- Name = "AssertClassName",
- 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.AbstractTests.ConcreteClass1", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1)),
- Name = "ConcreteClass1",
- Namespace = "TUnit.TestProject.AbstractTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- InstanceFactory = __CreateInstance,
- InvokeTypedTest = __InvokeTest,
+ return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes_0(int groupIndex)
+ {
+ return new global::System.Attribute[]
+ {
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute()
};
- metadata.UseRuntimeDataGeneration(testSessionId);
- return new global::TUnit.Core.TestMetadata[] { metadata };
}
- public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries_0 = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName",
- ClassName = "ConcreteClass1",
MethodName = "AssertClassName",
FullyQualifiedName = "TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName",
FilePath = @"",
@@ -65,34 +56,16 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = GetTests
- };
- }
- private static global::System.Attribute[] __CreateAttributes()
- {
- return
- [
- new global::TUnit.Core.TestAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute()
- ];
- }
- private static global::TUnit.TestProject.AbstractTests.ConcreteClass1 __CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AbstractTests.ConcreteClass1();
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest(global::TUnit.TestProject.AbstractTests.ConcreteClass1 instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance_0,
+ InvokeBody = __Invoke_0,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes_0,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource_0 = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource.Entries_0);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
index 9d37c10762..b258156575 100644
--- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -7,34 +7,64 @@ namespace TUnit.Generated;
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
internal static class TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource
{
- public static global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2)),
+ Name = "ConcreteClass2",
+ Namespace = "TUnit.TestProject.AbstractTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("SecondTest", __classType, typeof(void), __classMetadata);
+ private static global::TUnit.TestProject.AbstractTests.ConcreteClass2 __CreateInstance(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke(global::TUnit.TestProject.AbstractTests.ConcreteClass2 instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
{
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass2", new global::TUnit.Core.ClassMetadata
+ switch (methodIndex)
{
- Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2)),
- Name = "ConcreteClass2",
- Namespace = "TUnit.TestProject.AbstractTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2);
- var metadata_SecondTest = global::TUnit.Core.TestMetadataFactory.Create(
- "SecondTest", "SecondTest", 11,
- __InvokeTest_SecondTest, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("SecondTest", __classType, typeof(void), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata_SecondTest };
+ case 0:
+ {
+ try
+ {
+ instance.SecondTest();
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(methodIndex));
+ }
}
- public static global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ private static global::System.Attribute[] __Attributes(int groupIndex)
{
- yield return new global::TUnit.Core.TestDescriptor
+ switch (groupIndex)
+ {
+ case 0:
+ {
+ return
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute()
+ ];
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(groupIndex));
+ }
+ }
+ public static readonly global::TUnit.Core.TestEntry[] Entries = new global::TUnit.Core.TestEntry[]
+ {
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest",
- ClassName = "ConcreteClass2",
MethodName = "SecondTest",
FullyQualifiedName = "TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest",
FilePath = @"",
@@ -44,60 +74,18 @@ internal static class TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_SecondTest
- };
- }
- private static global::System.Attribute[] __CreateAttributes_0()
- {
- return
- [
- new global::TUnit.Core.TestAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute()
- ];
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_SecondTest(global::TUnit.TestProject.AbstractTests.ConcreteClass2 instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- instance.SecondTest();
- return default(global::System.Threading.Tasks.ValueTask);
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_SecondTest(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass2", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2)),
- Name = "ConcreteClass2",
- Namespace = "TUnit.TestProject.AbstractTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "SecondTest", "SecondTest", 11,
- __InvokeTest_SecondTest, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("SecondTest", __classType, typeof(void), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- internal static global::TUnit.TestProject.AbstractTests.ConcreteClass2 CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
- }
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.Entries);
}
@@ -110,57 +98,49 @@ internal static partial class TUnit_TestRegistration
namespace TUnit.Generated;
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
-internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+internal static class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource
{
- public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2)),
+ Name = "ConcreteClass2",
+ Namespace = "TUnit.TestProject.AbstractTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("AssertClassName", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static global::TUnit.TestProject.AbstractTests.ConcreteClass2 __CreateInstance_0(global::System.Type[] typeArgs, object?[] args)
{
- var metadata = new global::TUnit.Core.TestMetadata
+ return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke_0(global::TUnit.TestProject.AbstractTests.ConcreteClass2 instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ try
{
- TestName = "AssertClassName",
- TestClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
- TestMethodName = "AssertClassName",
- Dependencies = global::System.Array.Empty(),
- AttributeFactory = __CreateAttributes,
- DataSources = global::System.Array.Empty(),
- ClassDataSources = global::System.Array.Empty(),
- PropertyDataSources = global::System.Array.Empty(),
- PropertyInjections = global::System.Array.Empty(),
- InheritanceDepth = 2,
- FilePath = @"",
- LineNumber = 3,
- MethodMetadata = new global::TUnit.Core.MethodMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass)),
- Name = "AssertClassName",
- 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.AbstractTests.ConcreteClass2", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2)),
- Name = "ConcreteClass2",
- Namespace = "TUnit.TestProject.AbstractTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- InstanceFactory = __CreateInstance,
- InvokeTypedTest = __InvokeTest,
+ return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes_0(int groupIndex)
+ {
+ return new global::System.Attribute[]
+ {
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute()
};
- metadata.UseRuntimeDataGeneration(testSessionId);
- return new global::TUnit.Core.TestMetadata[] { metadata };
}
- public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries_0 = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName",
- ClassName = "ConcreteClass2",
MethodName = "AssertClassName",
FullyQualifiedName = "TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName",
FilePath = @"",
@@ -170,37 +150,18 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = GetTests
- };
- }
- private static global::System.Attribute[] __CreateAttributes()
- {
- return
- [
- new global::TUnit.Core.TestAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute()
- ];
- }
- private static global::TUnit.TestProject.AbstractTests.ConcreteClass2 __CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest(global::TUnit.TestProject.AbstractTests.ConcreteClass2 instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance_0,
+ InvokeBody = __Invoke_0,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes_0,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource_0 = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource.Entries_0);
}
@@ -213,57 +174,48 @@ internal static partial class TUnit_TestRegistration
namespace TUnit.Generated;
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
-internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource, global::TUnit.Core.Interfaces.SourceGenerator.ITestDescriptorSource
+internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource
{
- public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AbstractTests.ConcreteClass1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1)),
+ Name = "ConcreteClass1",
+ Namespace = "TUnit.TestProject.AbstractTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("AssertClassName", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static global::TUnit.TestProject.AbstractTests.ConcreteClass1 __CreateInstance_0(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.AbstractTests.ConcreteClass1();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke_0(global::TUnit.TestProject.AbstractTests.ConcreteClass1 instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
{
- var metadata = new global::TUnit.Core.TestMetadata
+ try
{
- TestName = "AssertClassName",
- TestClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
- TestMethodName = "AssertClassName",
- Dependencies = global::System.Array.Empty(),
- AttributeFactory = __CreateAttributes,
- DataSources = global::System.Array.Empty(),
- ClassDataSources = global::System.Array.Empty(),
- PropertyDataSources = global::System.Array.Empty(),
- PropertyInjections = global::System.Array.Empty(),
- InheritanceDepth = 1,
- FilePath = @"",
- LineNumber = 3,
- MethodMetadata = new global::TUnit.Core.MethodMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass)),
- Name = "AssertClassName",
- 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.AbstractTests.ConcreteClass1", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1)),
- Name = "ConcreteClass1",
- Namespace = "TUnit.TestProject.AbstractTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- InstanceFactory = __CreateInstance,
- InvokeTypedTest = __InvokeTest,
+ return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes_0(int groupIndex)
+ {
+ return new global::System.Attribute[]
+ {
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.Core.InheritsTestsAttribute()
};
- metadata.UseRuntimeDataGeneration(testSessionId);
- return new global::TUnit.Core.TestMetadata[] { metadata };
}
- public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries_0 = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName",
- ClassName = "ConcreteClass1",
MethodName = "AssertClassName",
FullyQualifiedName = "TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName",
FilePath = @"",
@@ -273,34 +225,16 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = GetTests
- };
- }
- private static global::System.Attribute[] __CreateAttributes()
- {
- return
- [
- new global::TUnit.Core.TestAttribute(),
- new global::TUnit.Core.InheritsTestsAttribute()
- ];
- }
- private static global::TUnit.TestProject.AbstractTests.ConcreteClass1 __CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AbstractTests.ConcreteClass1();
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest(global::TUnit.TestProject.AbstractTests.ConcreteClass1 instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.AssertClassName());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance_0,
+ InvokeBody = __Invoke_0,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes_0,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource_0 = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource.Entries_0);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
index fe4159b8ea..17ca7315df 100644
--- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -7,40 +7,73 @@ namespace TUnit.Generated;
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
{
- public static global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
{
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
+ Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
+ Name = "CleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_1 = global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static global::TUnit.TestProject.AfterTests.CleanupTests __CreateInstance(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.AfterTests.CleanupTests();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke(global::TUnit.TestProject.AfterTests.CleanupTests instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ switch (methodIndex)
{
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata_Test1 = global::TUnit.Core.TestMetadataFactory.Create(
- "Test1", "Test1", 98,
- __InvokeTest_Test1, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- var metadata_Test2 = global::TUnit.Core.TestMetadataFactory.Create(
- "Test2", "Test2", 104,
- __InvokeTest_Test2, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata_Test1, metadata_Test2 };
+ case 0:
+ {
+ try
+ {
+ return new global::System.Threading.Tasks.ValueTask(instance.Test1());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ case 1:
+ {
+ try
+ {
+ return new global::System.Threading.Tasks.ValueTask(instance.Test2());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(methodIndex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes(int groupIndex)
+ {
+ switch (groupIndex)
+ {
+ case 0:
+ {
+ return
+ [
+ new global::TUnit.Core.TestAttribute()
+ ];
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(groupIndex));
+ }
}
- public static global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AfterTests.CleanupTests.Test1",
- ClassName = "CleanupTests",
MethodName = "Test1",
FullyQualifiedName = "TUnit.TestProject.AfterTests.CleanupTests.Test1",
FilePath = @"",
@@ -50,12 +83,15 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Test1
- };
- yield return new global::TUnit.Core.TestDescriptor
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ },
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AfterTests.CleanupTests.Test2",
- ClassName = "CleanupTests",
MethodName = "Test2",
FullyQualifiedName = "TUnit.TestProject.AfterTests.CleanupTests.Test2",
FilePath = @"",
@@ -65,88 +101,16 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Test2
- };
- }
- private static global::System.Attribute[] __CreateAttributes_0()
- {
- return
- [
- new global::TUnit.Core.TestAttribute()
- ];
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Test1(global::TUnit.TestProject.AfterTests.CleanupTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.Test1());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Test2(global::TUnit.TestProject.AfterTests.CleanupTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.Test2());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Test1(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Test1", "Test1", 98,
- __InvokeTest_Test1, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Test2(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Test2", "Test2", 104,
- __InvokeTest_Test2, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- internal static global::TUnit.TestProject.AfterTests.CleanupTests CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AfterTests.CleanupTests();
- }
+ MethodMetadata = __mm_1,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 1,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
+ static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AfterTests_CleanupTests__TestSource.Entries);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
index fe4159b8ea..17ca7315df 100644
--- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -7,40 +7,73 @@ namespace TUnit.Generated;
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
{
- public static global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
{
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
+ Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
+ Name = "CleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_1 = global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata);
+ private static global::TUnit.TestProject.AfterTests.CleanupTests __CreateInstance(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.AfterTests.CleanupTests();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke(global::TUnit.TestProject.AfterTests.CleanupTests instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ switch (methodIndex)
{
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata_Test1 = global::TUnit.Core.TestMetadataFactory.Create(
- "Test1", "Test1", 98,
- __InvokeTest_Test1, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- var metadata_Test2 = global::TUnit.Core.TestMetadataFactory.Create(
- "Test2", "Test2", 104,
- __InvokeTest_Test2, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata_Test1, metadata_Test2 };
+ case 0:
+ {
+ try
+ {
+ return new global::System.Threading.Tasks.ValueTask(instance.Test1());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ case 1:
+ {
+ try
+ {
+ return new global::System.Threading.Tasks.ValueTask(instance.Test2());
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(methodIndex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes(int groupIndex)
+ {
+ switch (groupIndex)
+ {
+ case 0:
+ {
+ return
+ [
+ new global::TUnit.Core.TestAttribute()
+ ];
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(groupIndex));
+ }
}
- public static global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AfterTests.CleanupTests.Test1",
- ClassName = "CleanupTests",
MethodName = "Test1",
FullyQualifiedName = "TUnit.TestProject.AfterTests.CleanupTests.Test1",
FilePath = @"",
@@ -50,12 +83,15 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Test1
- };
- yield return new global::TUnit.Core.TestDescriptor
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ },
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.AfterTests.CleanupTests.Test2",
- ClassName = "CleanupTests",
MethodName = "Test2",
FullyQualifiedName = "TUnit.TestProject.AfterTests.CleanupTests.Test2",
FilePath = @"",
@@ -65,88 +101,16 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
HasDataSource = false,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Test2
- };
- }
- private static global::System.Attribute[] __CreateAttributes_0()
- {
- return
- [
- new global::TUnit.Core.TestAttribute()
- ];
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Test1(global::TUnit.TestProject.AfterTests.CleanupTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.Test1());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Test2(global::TUnit.TestProject.AfterTests.CleanupTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- return new global::System.Threading.Tasks.ValueTask(instance.Test2());
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Test1(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Test1", "Test1", 98,
- __InvokeTest_Test1, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test1", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Test2(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.CleanupTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.AfterTests.CleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.CleanupTests)),
- Name = "CleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.AfterTests.CleanupTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Test2", "Test2", 104,
- __InvokeTest_Test2, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Test2", __classType, typeof(global::System.Threading.Tasks.Task), __classMetadata),
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- internal static global::TUnit.TestProject.AfterTests.CleanupTests CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.AfterTests.CleanupTests();
- }
+ MethodMetadata = __mm_1,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 1,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
+ static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_AfterTests_CleanupTests__TestSource.Entries);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
index 0076876248..8ce74c5c18 100644
--- a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -7,68 +7,212 @@ namespace TUnit.Generated;
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
internal static class TUnit_TestProject_ArgsAsArrayTests__TestSource
{
- public static global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgsAsArrayTests", new global::TUnit.Core.ClassMetadata
{
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgsAsArrayTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.ArgsAsArrayTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgsAsArrayTests)),
- Name = "ArgsAsArrayTests",
- Namespace = "TUnit.TestProject",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.ArgsAsArrayTests);
- var metadata_Params__string__ = global::TUnit.Core.TestMetadataFactory.Create(
- "Params", "Params", 5,
- __InvokeTest_Params__string__, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(string[]), "arguments", new global::TUnit.Core.ConcreteType(typeof(string[])), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(string[]) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- var metadata_ParamsEnumerable__IEnumerable_string_ = global::TUnit.Core.TestMetadataFactory.Create(
- "ParamsEnumerable", "ParamsEnumerable", 15,
- __InvokeTest_ParamsEnumerable__IEnumerable_string_, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("ParamsEnumerable", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("ParamsEnumerable", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- var metadata_Following_Non_Params__int_IEnumerable_string_ = global::TUnit.Core.TestMetadataFactory.Create(
- "Following_Non_Params", "Following_Non_Params", 25,
- __InvokeTest_Following_Non_Params__int_IEnumerable_string_, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Following_Non_Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+ Type = typeof(global::TUnit.TestProject.ArgsAsArrayTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgsAsArrayTests)),
+ Name = "ArgsAsArrayTests",
+ Namespace = "TUnit.TestProject",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.ArgsAsArrayTests);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+{
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(string[]), "arguments", new global::TUnit.Core.ConcreteType(typeof(string[])), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(string[]) }, null)!.GetParameters()[0])
+});
+ private static readonly global::TUnit.Core.MethodMetadata __mm_1 = global::TUnit.Core.MethodMetadataFactory.Create("ParamsEnumerable", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+{
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("ParamsEnumerable", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0])
+});
+ private static readonly global::TUnit.Core.MethodMetadata __mm_2 = global::TUnit.Core.MethodMetadataFactory.Create("Following_Non_Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+{
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(int), "i", new global::TUnit.Core.ConcreteType(typeof(int)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0]),
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[1])
+});
+ private static global::TUnit.TestProject.ArgsAsArrayTests __CreateInstance(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.ArgsAsArrayTests();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke(global::TUnit.TestProject.ArgsAsArrayTests instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ switch (methodIndex)
{
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(int), "i", new global::TUnit.Core.ConcreteType(typeof(int)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[1])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
+ case 0:
+ {
+ try
+ {
+ switch (args.Length)
+ {
+ case 0:
+ {
+ instance.Params(new string[0]);
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 1:
+ {
+ instance.Params((args[0] is null ? null : args[0] is string[] arr ? arr : new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]) }));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 2:
+ {
+ instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]) });
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 3:
+ {
+ instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]) });
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 4:
+ {
+ instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]) });
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 5:
+ {
+ instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]), global::TUnit.Core.Helpers.CastHelper.Cast(args[4]) });
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 6:
+ {
+ instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]), global::TUnit.Core.Helpers.CastHelper.Cast(args[4]), global::TUnit.Core.Helpers.CastHelper.Cast(args[5]) });
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ default:
+ throw new global::System.ArgumentException($"Expected between 0 and 1 arguments, but got {args.Length}");
+ }
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ case 1:
+ {
+ try
+ {
+ switch (args.Length)
+ {
+ case 0:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 1:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 2:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 3:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 4:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 5:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 6:
+ {
+ instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ default:
+ throw new global::System.ArgumentException($"Expected between 0 and 1 arguments, but got {args.Length}");
+ }
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ case 2:
+ {
+ try
+ {
+ switch (args.Length)
+ {
+ case 1:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 2:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 3:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 4:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 5:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 6:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ case 7:
+ {
+ instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ default:
+ throw new global::System.ArgumentException($"Expected between 1 and 2 arguments, but got {args.Length}");
+ }
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(methodIndex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes(int groupIndex)
+ {
+ switch (groupIndex)
{
- new global::TUnit.Core.ArgumentsAttribute(1, "arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata_Params__string__, metadata_ParamsEnumerable__IEnumerable_string_, metadata_Following_Non_Params__int_IEnumerable_string_ };
+ case 0:
+ {
+ return
+ [
+ new global::TUnit.Core.TestAttribute()
+ ];
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(groupIndex));
+ }
}
- public static global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry[] Entries = new global::TUnit.Core.TestEntry[]
{
- yield return new global::TUnit.Core.TestDescriptor
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.ArgsAsArrayTests.Params",
- ClassName = "ArgsAsArrayTests",
MethodName = "Params",
FullyQualifiedName = "TUnit.TestProject.ArgsAsArrayTests.Params",
FilePath = @"",
@@ -78,12 +222,19 @@ internal static class TUnit_TestProject_ArgsAsArrayTests__TestSource
HasDataSource = true,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Params__string__
- };
- yield return new global::TUnit.Core.TestDescriptor
+ MethodMetadata = __mm_0,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 0,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ TestDataSources = new global::TUnit.Core.IDataSourceAttribute[]
+{
+ new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
+},
+ },
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.ArgsAsArrayTests.ParamsEnumerable",
- ClassName = "ArgsAsArrayTests",
MethodName = "ParamsEnumerable",
FullyQualifiedName = "TUnit.TestProject.ArgsAsArrayTests.ParamsEnumerable",
FilePath = @"",
@@ -93,12 +244,19 @@ internal static class TUnit_TestProject_ArgsAsArrayTests__TestSource
HasDataSource = true,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_ParamsEnumerable__IEnumerable_string_
- };
- yield return new global::TUnit.Core.TestDescriptor
+ MethodMetadata = __mm_1,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 1,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ TestDataSources = new global::TUnit.Core.IDataSourceAttribute[]
+{
+ new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
+},
+ },
+ new global::TUnit.Core.TestEntry
{
- TestId = "TUnit.TestProject.ArgsAsArrayTests.Following_Non_Params",
- ClassName = "ArgsAsArrayTests",
MethodName = "Following_Non_Params",
FullyQualifiedName = "TUnit.TestProject.ArgsAsArrayTests.Following_Non_Params",
FilePath = @"",
@@ -108,260 +266,20 @@ internal static class TUnit_TestProject_ArgsAsArrayTests__TestSource
HasDataSource = true,
RepeatCount = 0,
DependsOn = global::System.Array.Empty(),
- Materializer = __Materialize_Following_Non_Params__int_IEnumerable_string_
- };
- }
- private static global::System.Attribute[] __CreateAttributes_0()
- {
- return
- [
- new global::TUnit.Core.TestAttribute()
- ];
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Params__string__(global::TUnit.TestProject.ArgsAsArrayTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- switch (args.Length)
- {
- case 0:
- {
- instance.Params(new string[0]);
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 1:
- {
- instance.Params((args[0] is null ? null : args[0] is string[] arr ? arr : new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]) }));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 2:
- {
- instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]) });
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 3:
- {
- instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]) });
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 4:
- {
- instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]) });
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 5:
- {
- instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]), global::TUnit.Core.Helpers.CastHelper.Cast(args[4]) });
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 6:
- {
- instance.Params(new string[] { global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2]), global::TUnit.Core.Helpers.CastHelper.Cast(args[3]), global::TUnit.Core.Helpers.CastHelper.Cast(args[4]), global::TUnit.Core.Helpers.CastHelper.Cast(args[5]) });
- return default(global::System.Threading.Tasks.ValueTask);
- }
- default:
- throw new global::System.ArgumentException($"Expected between 0 and 1 arguments, but got {args.Length}");
- }
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_ParamsEnumerable__IEnumerable_string_(global::TUnit.TestProject.ArgsAsArrayTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- switch (args.Length)
- {
- case 0:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 1:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 2:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 3:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 4:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 5:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 6:
- {
- instance.ParamsEnumerable(global::TUnit.Core.Helpers.CastHelper.Cast>(args[0]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- default:
- throw new global::System.ArgumentException($"Expected between 0 and 1 arguments, but got {args.Length}");
- }
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Threading.Tasks.ValueTask __InvokeTest_Following_Non_Params__int_IEnumerable_string_(global::TUnit.TestProject.ArgsAsArrayTests instance, object?[] args, global::System.Threading.CancellationToken cancellationToken)
- {
- try
- {
- switch (args.Length)
- {
- case 1:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 2:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 3:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 4:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 5:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 6:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- case 7:
- {
- instance.Following_Non_Params(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast>(args[1]));
- return default(global::System.Threading.Tasks.ValueTask);
- }
- default:
- throw new global::System.ArgumentException($"Expected between 1 and 2 arguments, but got {args.Length}");
- }
- }
- catch (global::System.Exception ex)
- {
- return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
- }
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Params__string__(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgsAsArrayTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.ArgsAsArrayTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgsAsArrayTests)),
- Name = "ArgsAsArrayTests",
- Namespace = "TUnit.TestProject",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.ArgsAsArrayTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Params", "Params", 5,
- __InvokeTest_Params__string__, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(string[]), "arguments", new global::TUnit.Core.ConcreteType(typeof(string[])), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(string[]) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_ParamsEnumerable__IEnumerable_string_(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgsAsArrayTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.ArgsAsArrayTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgsAsArrayTests)),
- Name = "ArgsAsArrayTests",
- Namespace = "TUnit.TestProject",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.ArgsAsArrayTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "ParamsEnumerable", "ParamsEnumerable", 15,
- __InvokeTest_ParamsEnumerable__IEnumerable_string_, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("ParamsEnumerable", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("ParamsEnumerable", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute("arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- private static global::System.Collections.Generic.IReadOnlyList __Materialize_Following_Non_Params__int_IEnumerable_string_(string testSessionId)
- {
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgsAsArrayTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.ArgsAsArrayTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgsAsArrayTests)),
- Name = "ArgsAsArrayTests",
- Namespace = "TUnit.TestProject",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.ArgsAsArrayTests);
- var metadata = global::TUnit.Core.TestMetadataFactory.Create(
- "Following_Non_Params", "Following_Non_Params", 25,
- __InvokeTest_Following_Non_Params__int_IEnumerable_string_, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Following_Non_Params", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(int), "i", new global::TUnit.Core.ConcreteType(typeof(int)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Collections.Generic.IEnumerable), "arguments", new global::TUnit.Core.ConcreteType(typeof(global::System.Collections.Generic.IEnumerable)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgsAsArrayTests).GetMethod("Following_Non_Params", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(int), typeof(global::System.Collections.Generic.IEnumerable) }, null)!.GetParameters()[1])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute(1, "arg1", "arg2", "arg3"),
- },
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata };
- }
- internal static global::TUnit.TestProject.ArgsAsArrayTests CreateInstance(global::System.Type[] typeArgs, object?[] args)
- {
- return new global::TUnit.TestProject.ArgsAsArrayTests();
- }
+ MethodMetadata = __mm_2,
+ CreateInstance = __CreateInstance,
+ InvokeBody = __Invoke,
+ MethodIndex = 2,
+ CreateAttributes = __Attributes,
+ AttributeGroupIndex = 0,
+ TestDataSources = new global::TUnit.Core.IDataSourceAttribute[]
+{
+ new global::TUnit.Core.ArgumentsAttribute(1, "arg1", "arg2", "arg3"),
+},
+ },
+ };
}
internal static partial class TUnit_TestRegistration
{
- static readonly int _r_TUnit_TestProject_ArgsAsArrayTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ArgsAsArrayTests), TUnit_TestProject_ArgsAsArrayTests__TestSource.GetTests, TUnit_TestProject_ArgsAsArrayTests__TestSource.EnumerateTestDescriptors);
+ static readonly int _r_TUnit_TestProject_ArgsAsArrayTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterEntries(TUnit_TestProject_ArgsAsArrayTests__TestSource.Entries);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
index 8591dcea4a..5a53b13b3c 100644
--- a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -7,58 +7,98 @@ namespace TUnit.Generated;
[global::System.CodeDom.Compiler.GeneratedCode("TUnit", "VERSION_SCRUBBED")]
internal static class TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource
{
- public static global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)
+ private static readonly global::TUnit.Core.ClassMetadata __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgumentWithImplicitConverterTests", new global::TUnit.Core.ClassMetadata
{
- var __classMetadata = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.ArgumentWithImplicitConverterTests", new global::TUnit.Core.ClassMetadata
- {
- Type = typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests)),
- Name = "ArgumentWithImplicitConverterTests",
- Namespace = "TUnit.TestProject",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- });
- var __classType = typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests);
- var metadata_Explicit__ExplicitInteger = global::TUnit.Core.TestMetadataFactory.Create(
- "Explicit", "Explicit", 8,
- __InvokeTest_Explicit__ExplicitInteger, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Explicit", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.TestProject.ExplicitInteger), "integer", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ExplicitInteger)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests).GetMethod("Explicit", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.TestProject.ExplicitInteger) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
- {
- new global::TUnit.Core.ArgumentsAttribute(1),
- new global::TUnit.Core.ArgumentsAttribute(2),
- new global::TUnit.Core.ArgumentsAttribute(3),
- },
- testSessionId: testSessionId
- );
- var metadata_Implicit__ImplicitInteger = global::TUnit.Core.TestMetadataFactory.Create(
- "Implicit", "Implicit", 17,
- __InvokeTest_Implicit__ImplicitInteger, __CreateAttributes_0, CreateInstance,
- global::TUnit.Core.MethodMetadataFactory.Create("Implicit", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+ Type = typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests)),
+ Name = "ArgumentWithImplicitConverterTests",
+ Namespace = "TUnit.TestProject",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ });
+ private static readonly global::System.Type __classType = typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests);
+ private static readonly global::TUnit.Core.MethodMetadata __mm_0 = global::TUnit.Core.MethodMetadataFactory.Create("Explicit", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+{
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.TestProject.ExplicitInteger), "integer", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ExplicitInteger)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests).GetMethod("Explicit", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.TestProject.ExplicitInteger) }, null)!.GetParameters()[0])
+});
+ private static readonly global::TUnit.Core.MethodMetadata __mm_1 = global::TUnit.Core.MethodMetadataFactory.Create("Implicit", __classType, typeof(void), __classMetadata, parameters: new global::TUnit.Core.ParameterMetadata[]
+{
+global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.TestProject.ImplicitInteger), "integer", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ImplicitInteger)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests).GetMethod("Implicit", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.TestProject.ImplicitInteger) }, null)!.GetParameters()[0])
+});
+ private static global::TUnit.TestProject.ArgumentWithImplicitConverterTests __CreateInstance(global::System.Type[] typeArgs, object?[] args)
+ {
+ return new global::TUnit.TestProject.ArgumentWithImplicitConverterTests();
+ }
+ private static global::System.Threading.Tasks.ValueTask __Invoke(global::TUnit.TestProject.ArgumentWithImplicitConverterTests instance, int methodIndex, object?[] args, global::System.Threading.CancellationToken cancellationToken)
+ {
+ switch (methodIndex)
{
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.TestProject.ImplicitInteger), "integer", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.ImplicitInteger)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests).GetMethod("Implicit", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.TestProject.ImplicitInteger) }, null)!.GetParameters()[0])
- }),
- dataSources: new global::TUnit.Core.IDataSourceAttribute[]
+ case 0:
+ {
+ try
+ {
+ switch (args.Length)
+ {
+ case 1:
+ {
+ instance.Explicit(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ default:
+ throw new global::System.ArgumentException($"Expected exactly 1 argument, but got {args.Length}");
+ }
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ case 1:
+ {
+ try
+ {
+ switch (args.Length)
+ {
+ case 1:
+ {
+ instance.Implicit(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
+ return default(global::System.Threading.Tasks.ValueTask);
+ }
+ default:
+ throw new global::System.ArgumentException($"Expected exactly 1 argument, but got {args.Length}");
+ }
+ }
+ catch (global::System.Exception ex)
+ {
+ return new global::System.Threading.Tasks.ValueTask(global::System.Threading.Tasks.Task.FromException(ex));
+ }
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(methodIndex));
+ }
+ }
+ private static global::System.Attribute[] __Attributes(int groupIndex)
+ {
+ switch (groupIndex)
{
- new global::TUnit.Core.ArgumentsAttribute(1),
- new global::TUnit.Core.ArgumentsAttribute(2),
- new global::TUnit.Core.ArgumentsAttribute(3),
- },
- testSessionId: testSessionId
- );
- return new global::TUnit.Core.TestMetadata[] { metadata_Explicit__ExplicitInteger, metadata_Implicit__ImplicitInteger };
+ case 0:
+ {
+ return
+ [
+ new global::TUnit.Core.TestAttribute(),
+ new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass)
+ ];
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(groupIndex));
+ }
}
- public static global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors()
+ public static readonly global::TUnit.Core.TestEntry