diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt index fab1f88ef0..d25c50fd21 100644 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt index 66defbf2bf..8aac896da7 100644 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -157,7 +156,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -171,8 +170,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -189,7 +187,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -214,7 +212,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -259,7 +257,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -273,8 +271,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -291,7 +288,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt index 4e30952655..a3ad44119d 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -65,8 +65,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -83,7 +82,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -108,7 +107,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -152,7 +151,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -166,8 +165,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -184,7 +182,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt index 4e30952655..a3ad44119d 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -65,8 +65,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -83,7 +82,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -108,7 +107,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -152,7 +151,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AfterTests.CleanupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -166,8 +165,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -184,7 +182,7 @@ internal sealed class TUnit_TestProject_AfterTests_CleanupTests_Test2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt index b9d2d43b8e..e8a0fbcbfc 100644 --- a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ArgsAsArrayTests_Params__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -63,7 +63,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Params__string___TestSo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -116,8 +116,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Params__string___TestSo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -134,7 +133,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Params__string___TestSo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -159,7 +158,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ArgsAsArrayTests_ParamsEnumerable__IEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -215,7 +214,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_ParamsEnumerable__IEnum return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +267,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_ParamsEnumerable__IEnum }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +284,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_ParamsEnumerable__IEnum HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -311,7 +309,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ArgsAsArrayTests_Following_Non_Params__int_IEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -374,7 +372,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Following_Non_Params__i return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ArgsAsArrayTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -427,8 +425,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Following_Non_Params__i }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -445,7 +442,7 @@ internal sealed class TUnit_TestProject_ArgsAsArrayTests_Following_Non_Params__i HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt index 560c393dac..1cf5c30af4 100644 --- a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Explicit__ExplicitInteger_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Expli return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ArgumentWithImplicitConverterTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ArgumentWithImplicitConverterTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Expli }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Expli HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Implicit__ImplicitInteger_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -191,7 +190,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Impli return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ArgumentWithImplicitConverterTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ArgumentWithImplicitConverterTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -214,8 +213,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Impli }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -232,7 +230,7 @@ internal sealed class TUnit_TestProject_ArgumentWithImplicitConverterTests_Impli HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt index 57a80528d1..1a37a733f3 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt index 7cc93123c2..21dc9a469f 100644 --- a/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_SingleValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -85,7 +85,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -107,8 +107,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -125,7 +124,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -150,7 +149,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_Tuples__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -235,7 +234,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -257,8 +256,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -275,7 +273,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -300,7 +298,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_Enumerable__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -378,7 +376,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -400,8 +398,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -418,7 +415,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -443,7 +440,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_Func__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -521,7 +518,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -543,8 +540,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -561,7 +557,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -586,7 +582,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_WithArguments__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -664,7 +660,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -686,8 +682,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -704,7 +699,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -729,7 +724,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMethodDataSource_ExternalClass__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -807,7 +802,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -829,8 +824,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -847,7 +841,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_AsyncMe HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -872,7 +866,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_ValueTaskMethodDataSource_SingleValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -950,7 +944,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_ValueTa return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -972,8 +966,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_ValueTa }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -990,7 +983,7 @@ internal sealed class TUnit_TestProject_AsyncMethodDataSourceDrivenTests_ValueTa HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt index 7eca6abcb4..0421b1ffd6 100644 --- a/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AttributeTests_MyTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -63,7 +63,7 @@ internal sealed class TUnit_TestProject_AttributeTests_MyTest_TestSource : globa return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AttributeTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AttributeTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -78,8 +78,7 @@ internal sealed class TUnit_TestProject_AttributeTests_MyTest_TestSource : globa }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -96,7 +95,7 @@ internal sealed class TUnit_TestProject_AttributeTests_MyTest_TestSource : globa HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt index 57a80528d1..1a37a733f3 100644 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt index 81dd40abed..009aa1988c 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -65,8 +65,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -83,7 +82,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -108,7 +107,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -152,7 +151,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -166,8 +165,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -184,7 +182,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt index 81dd40abed..009aa1988c 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -65,8 +65,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -83,7 +82,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -108,7 +107,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -152,7 +151,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BeforeTests.SetupTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -166,8 +165,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -184,7 +182,7 @@ internal sealed class TUnit_TestProject_BeforeTests_SetupTests_Test2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt index 59f9b93459..848ae53d1e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -67,8 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -85,7 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt index 59f9b93459..848ae53d1e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -67,8 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -85,7 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt index 59f9b93459..848ae53d1e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -67,8 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -85,7 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt index 8421d3b61d..86af5fe29b 100644 --- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2971.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -67,8 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -85,7 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__2971_Tests_SimpleTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt index 6545b68675..890d5a28e0 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_Simple_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_Simple_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassAndMethodArgumentsTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -83,8 +83,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_Simple_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -101,7 +100,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_Simple_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -126,7 +125,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_WithMethodLevel__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_WithMethodL return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassAndMethodArgumentsTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -223,8 +222,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_WithMethodL }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -241,7 +239,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_WithMethodL HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -266,7 +264,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_IgnoreParameters__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -338,7 +336,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_IgnoreParam return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassAndMethodArgumentsTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -363,8 +361,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_IgnoreParam }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -381,7 +378,7 @@ internal sealed class TUnit_TestProject_ClassAndMethodArgumentsTests_IgnoreParam HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt index 04f2dca959..31c8d2d0a7 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassConstructorTest_Test_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -79,7 +79,7 @@ internal sealed class TUnit_TestProject_ClassConstructorTest_Test_TestSource : g return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { // ClassConstructor attribute is present - instance creation handled at runtime throw new global::System.NotSupportedException("Instance creation for classes with ClassConstructor attribute is handled at runtime"); @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_ClassConstructorTest_Test_TestSource : g }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_ClassConstructorTest_Test_TestSource : g HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt index a4d2604ec3..489135d2dd 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Class__SomeAsyncDisposableClass_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -87,8 +87,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -105,7 +104,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -130,7 +129,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Class_Generic__SomeAsyncDisposableClass_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -187,7 +186,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -210,8 +209,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -228,7 +226,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_DataSource_Cl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -253,7 +251,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized_With_1_ClassDataSource__Ini_01E5B4B7_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -310,7 +308,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -332,8 +330,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -350,7 +347,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -375,7 +372,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized_With_2_ClassDataSources__In_52B92153_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -439,7 +436,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -461,8 +458,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -479,7 +475,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -504,7 +500,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized_With_3_ClassDataSources__In_8432A34C_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -575,7 +571,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -597,8 +593,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -615,7 +610,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -640,7 +635,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized_With_4_ClassDataSources__In_159CD9D1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -718,7 +713,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -740,8 +735,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -758,7 +752,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -783,7 +777,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized_With_5_ClassDataSources__In_CB437346_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -868,7 +862,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -890,8 +884,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -908,7 +901,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests_IsInitialized HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt index 7e4bd68c68..b8666db842 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -67,7 +67,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassDataSourceDrivenTests2(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -85,8 +85,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -103,7 +102,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -128,7 +127,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -188,7 +187,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassDataSourceDrivenTests2(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -206,8 +205,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -224,7 +222,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTests2_Base_Derived HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt index 02d1a1c367..7349288d72 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_DataSource_Class__SomeAsyncDis_82F9A818_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -65,7 +65,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -88,8 +88,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -106,7 +105,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -131,7 +130,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_DataSource_Class_Generic__Some_7FC73642_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -189,7 +188,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -212,8 +211,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -230,7 +228,7 @@ internal sealed class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed_Da HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt index 154c83218f..ca178e8615 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt @@ -17,7 +17,7 @@ internal sealed class TUnit_TestProject_ClassTupleDataSourceDrivenTests_DataSour [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref global::System.ValueTuple GetProperty4BackingField(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -349,7 +349,7 @@ internal sealed class TUnit_TestProject_ClassTupleDataSourceDrivenTests_DataSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2])) { @@ -381,8 +381,7 @@ internal sealed class TUnit_TestProject_ClassTupleDataSourceDrivenTests_DataSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -399,7 +398,7 @@ internal sealed class TUnit_TestProject_ClassTupleDataSourceDrivenTests_DataSour HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt index 66defbf2bf..8aac896da7 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -157,7 +156,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -171,8 +170,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -189,7 +187,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -214,7 +212,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -259,7 +257,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -273,8 +271,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -291,7 +288,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet10_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet8_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet9_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.Net4_7.verified.txt index 57a80528d1..1a37a733f3 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.BasicTest_WithConflictingNamespace.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet10_0.verified.txt index 3992088a19..1f79ca1e5f 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -221,8 +220,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -239,7 +237,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -264,7 +262,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -323,7 +321,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -346,8 +344,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -364,7 +361,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -389,7 +386,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -446,7 +443,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -469,8 +466,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -487,7 +483,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -512,7 +508,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -569,7 +565,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -592,8 +588,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -610,7 +605,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -635,7 +630,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -692,7 +687,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -715,8 +710,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -733,7 +727,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -758,7 +752,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -817,7 +811,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -840,8 +834,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -858,7 +851,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -883,7 +876,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -940,7 +933,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -963,8 +956,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -981,7 +973,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1006,7 +998,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1063,7 +1055,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1086,8 +1078,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1104,7 +1095,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1129,7 +1120,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1186,7 +1177,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1209,8 +1200,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1227,7 +1217,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet8_0.verified.txt index 3992088a19..1f79ca1e5f 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -221,8 +220,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -239,7 +237,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -264,7 +262,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -323,7 +321,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -346,8 +344,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -364,7 +361,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -389,7 +386,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -446,7 +443,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -469,8 +466,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -487,7 +483,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -512,7 +508,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -569,7 +565,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -592,8 +588,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -610,7 +605,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -635,7 +630,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -692,7 +687,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -715,8 +710,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -733,7 +727,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -758,7 +752,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -817,7 +811,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -840,8 +834,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -858,7 +851,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -883,7 +876,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -940,7 +933,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -963,8 +956,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -981,7 +973,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1006,7 +998,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1063,7 +1055,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1086,8 +1078,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1104,7 +1095,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1129,7 +1120,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1186,7 +1177,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1209,8 +1200,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1227,7 +1217,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet9_0.verified.txt index 3992088a19..1f79ca1e5f 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -221,8 +220,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -239,7 +237,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -264,7 +262,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -323,7 +321,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -346,8 +344,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -364,7 +361,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -389,7 +386,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -446,7 +443,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -469,8 +466,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -487,7 +483,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -512,7 +508,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -569,7 +565,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -592,8 +588,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -610,7 +605,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -635,7 +630,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -692,7 +687,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -715,8 +710,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -733,7 +727,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -758,7 +752,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -817,7 +811,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -840,8 +834,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -858,7 +851,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -883,7 +876,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -940,7 +933,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -963,8 +956,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -981,7 +973,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1006,7 +998,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1063,7 +1055,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1086,8 +1078,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1104,7 +1095,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1129,7 +1120,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1186,7 +1177,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1209,8 +1200,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1227,7 +1217,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.Net4_7.verified.txt index 6c94c4e39b..a342948bb1 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.DataDrivenTest_WithConflictingNamespace.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -221,8 +220,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -239,7 +237,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -264,7 +262,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -323,7 +321,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -346,8 +344,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -364,7 +361,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -389,7 +386,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -446,7 +443,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -469,8 +466,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -487,7 +483,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -512,7 +508,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -569,7 +565,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -592,8 +588,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -610,7 +605,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -635,7 +630,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -692,7 +687,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -715,8 +710,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -733,7 +727,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -758,7 +752,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -817,7 +811,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -840,8 +834,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -858,7 +851,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -883,7 +876,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -940,7 +933,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -963,8 +956,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -981,7 +973,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1006,7 +998,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1063,7 +1055,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1086,8 +1078,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1104,7 +1095,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1129,7 +1120,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1186,7 +1177,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1209,8 +1200,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1227,7 +1217,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet10_0.verified.txt index aed83e58e3..02f4777aa0 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -100,8 +100,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -118,7 +117,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -143,7 +142,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -221,7 +220,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -243,8 +242,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -261,7 +259,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -286,7 +284,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnum_TestEnum__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -357,7 +355,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -379,8 +377,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -397,7 +394,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -422,7 +419,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -486,7 +483,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -508,8 +505,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -526,7 +522,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -551,7 +547,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -615,7 +611,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -637,8 +633,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -655,7 +650,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -680,7 +675,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_TestEnum__TestEnum2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -744,7 +739,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -766,8 +761,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -784,7 +778,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -809,7 +803,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrixValues__CountToTenEnum_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -873,7 +867,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -895,8 +889,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -913,7 +906,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -938,7 +931,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -995,7 +988,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1017,8 +1010,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1035,7 +1027,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1060,7 +1052,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1117,7 +1109,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1139,8 +1131,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1157,7 +1148,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1182,7 +1173,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1239,7 +1230,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1261,8 +1252,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1279,7 +1269,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1304,7 +1294,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1361,7 +1351,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1383,8 +1373,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1401,7 +1390,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1426,7 +1415,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1493,7 +1482,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1515,8 +1504,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1533,7 +1521,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1558,7 +1546,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParameter_UsesOnlyMethodValues__boo_38BEEE8F_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1622,7 +1610,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1644,8 +1632,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1662,7 +1649,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet8_0.verified.txt index aed83e58e3..02f4777aa0 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -100,8 +100,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -118,7 +117,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -143,7 +142,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -221,7 +220,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -243,8 +242,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -261,7 +259,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -286,7 +284,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnum_TestEnum__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -357,7 +355,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -379,8 +377,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -397,7 +394,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -422,7 +419,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -486,7 +483,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -508,8 +505,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -526,7 +522,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -551,7 +547,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -615,7 +611,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -637,8 +633,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -655,7 +650,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -680,7 +675,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_TestEnum__TestEnum2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -744,7 +739,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -766,8 +761,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -784,7 +778,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -809,7 +803,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrixValues__CountToTenEnum_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -873,7 +867,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -895,8 +889,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -913,7 +906,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -938,7 +931,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -995,7 +988,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1017,8 +1010,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1035,7 +1027,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1060,7 +1052,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1117,7 +1109,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1139,8 +1131,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1157,7 +1148,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1182,7 +1173,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1239,7 +1230,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1261,8 +1252,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1279,7 +1269,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1304,7 +1294,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1361,7 +1351,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1383,8 +1373,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1401,7 +1390,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1426,7 +1415,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1493,7 +1482,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1515,8 +1504,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1533,7 +1521,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1558,7 +1546,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParameter_UsesOnlyMethodValues__boo_38BEEE8F_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1622,7 +1610,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1644,8 +1632,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1662,7 +1649,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet9_0.verified.txt index aed83e58e3..02f4777aa0 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -100,8 +100,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -118,7 +117,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -143,7 +142,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -221,7 +220,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -243,8 +242,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -261,7 +259,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -286,7 +284,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnum_TestEnum__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -357,7 +355,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -379,8 +377,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -397,7 +394,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -422,7 +419,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -486,7 +483,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -508,8 +505,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -526,7 +522,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -551,7 +547,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -615,7 +611,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -637,8 +633,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -655,7 +650,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -680,7 +675,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_TestEnum__TestEnum2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -744,7 +739,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -766,8 +761,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -784,7 +778,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -809,7 +803,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrixValues__CountToTenEnum_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -873,7 +867,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -895,8 +889,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -913,7 +906,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -938,7 +931,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -995,7 +988,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1017,8 +1010,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1035,7 +1027,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1060,7 +1052,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1117,7 +1109,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1139,8 +1131,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1157,7 +1148,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1182,7 +1173,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1239,7 +1230,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1261,8 +1252,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1279,7 +1269,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1304,7 +1294,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1361,7 +1351,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1383,8 +1373,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1401,7 +1390,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1426,7 +1415,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1493,7 +1482,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1515,8 +1504,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1533,7 +1521,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1558,7 +1546,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParameter_UsesOnlyMethodValues__boo_38BEEE8F_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1622,7 +1610,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1644,8 +1632,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1662,7 +1649,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.Net4_7.verified.txt index 9d3b3b6d00..664d214195 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MatrixTest_WithConflictingNamespace.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -100,8 +100,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -118,7 +117,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -143,7 +142,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -221,7 +220,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -243,8 +242,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -261,7 +259,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -286,7 +284,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnum_TestEnum__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -357,7 +355,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -379,8 +377,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -397,7 +394,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -422,7 +419,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -486,7 +483,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -508,8 +505,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -526,7 +522,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -551,7 +547,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -615,7 +611,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -637,8 +633,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -655,7 +650,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -680,7 +675,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_TestEnum__TestEnum2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -744,7 +739,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -766,8 +761,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -784,7 +778,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -809,7 +803,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrixValues__CountToTenEnum_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -873,7 +867,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -895,8 +889,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -913,7 +906,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -938,7 +931,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -995,7 +988,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1017,8 +1010,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1035,7 +1027,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1060,7 +1052,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1117,7 +1109,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1139,8 +1131,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1157,7 +1148,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1182,7 +1173,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1239,7 +1230,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1261,8 +1252,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1279,7 +1269,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1304,7 +1294,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1361,7 +1351,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1383,8 +1373,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1401,7 +1390,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1426,7 +1415,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1493,7 +1482,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1515,8 +1504,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1533,7 +1521,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1558,7 +1546,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParameter_UsesOnlyMethodValues__boo_38BEEE8F_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1622,7 +1610,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1644,8 +1632,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1662,7 +1649,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet10_0.verified.txt index e736239c19..39f104fc47 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -209,7 +208,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -232,8 +231,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -250,7 +248,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -275,7 +273,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method_WithAction__Action_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -343,7 +341,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -366,8 +364,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -384,7 +381,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -409,7 +406,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -515,8 +512,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -533,7 +529,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -558,7 +554,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -668,7 +664,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -691,8 +687,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -709,7 +704,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -734,7 +729,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -802,7 +797,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -825,8 +820,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -843,7 +837,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -868,7 +862,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFuncArrayTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -946,7 +940,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -968,8 +962,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -986,7 +979,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet8_0.verified.txt index e736239c19..39f104fc47 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -209,7 +208,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -232,8 +231,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -250,7 +248,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -275,7 +273,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method_WithAction__Action_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -343,7 +341,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -366,8 +364,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -384,7 +381,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -409,7 +406,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -515,8 +512,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -533,7 +529,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -558,7 +554,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -668,7 +664,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -691,8 +687,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -709,7 +704,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -734,7 +729,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -802,7 +797,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -825,8 +820,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -843,7 +837,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -868,7 +862,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFuncArrayTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -946,7 +940,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -968,8 +962,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -986,7 +979,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet9_0.verified.txt index e736239c19..39f104fc47 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -209,7 +208,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -232,8 +231,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -250,7 +248,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -275,7 +273,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method_WithAction__Action_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -343,7 +341,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -366,8 +364,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -384,7 +381,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -409,7 +406,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -515,8 +512,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -533,7 +529,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -558,7 +554,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -668,7 +664,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -691,8 +687,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -709,7 +704,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -734,7 +729,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -802,7 +797,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -825,8 +820,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -843,7 +837,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -868,7 +862,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFuncArrayTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -946,7 +940,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -968,8 +962,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -986,7 +979,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.Net4_7.verified.txt index 08e224c9c6..c265ac1e49 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.MethodDataSource_WithConflictingNamespace.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -209,7 +208,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -232,8 +231,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -250,7 +248,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -275,7 +273,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method_WithAction__Action_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -343,7 +341,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -366,8 +364,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -384,7 +381,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -409,7 +406,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -515,8 +512,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -533,7 +529,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -558,7 +554,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -668,7 +664,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -691,8 +687,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -709,7 +704,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -734,7 +729,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -802,7 +797,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -825,8 +820,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -843,7 +837,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -868,7 +862,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFuncArrayTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -946,7 +940,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -968,8 +962,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -986,7 +979,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet10_0.verified.txt index ccf119c861..80318b84bc 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -89,7 +89,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -112,8 +112,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -130,7 +129,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet8_0.verified.txt index ccf119c861..80318b84bc 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -89,7 +89,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -112,8 +112,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -130,7 +129,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet9_0.verified.txt index ccf119c861..80318b84bc 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -89,7 +89,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -112,8 +112,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -130,7 +129,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.Net4_7.verified.txt index 17e30917c6..b647e7abe2 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.TupleDataSource_WithConflictingNamespace.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -89,7 +89,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -112,8 +112,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -130,7 +129,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt index 9468e3d4b9..c31ef96e6c 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_String1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_String1__string_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_String1__string_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_String1__string_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -129,7 +128,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_Int__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -186,7 +185,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Int__int_TestSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -208,8 +207,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Int__int_TestSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -226,7 +224,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Int__int_TestSour HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -251,7 +249,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_Double__double_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -308,7 +306,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Double__double_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -330,8 +328,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Double__double_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -348,7 +345,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Double__double_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -373,7 +370,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_Float__float_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -430,7 +427,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Float__float_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -452,8 +449,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Float__float_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -470,7 +466,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Float__float_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -495,7 +491,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_Long__long_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -552,7 +548,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Long__long_TestSo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -574,8 +570,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Long__long_TestSo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -592,7 +587,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_Long__long_TestSo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -617,7 +612,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_UInt__uint_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -674,7 +669,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_UInt__uint_TestSo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -696,8 +691,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_UInt__uint_TestSo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -714,7 +708,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_UInt__uint_TestSo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -739,7 +733,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstantArgumentsTests_ULong__ulong_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -796,7 +790,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_ULong__ulong_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConstantArgumentsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -818,8 +812,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_ULong__ulong_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -836,7 +829,7 @@ internal sealed class TUnit_TestProject_ConstantArgumentsTests_ULong__ulong_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt index 1ecb10a0ce..5433a00830 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests_SomeTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests_Some return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests_Some }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests_Some HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt index 2277beb63b..cf2290fcc7 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests_SomeTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedString return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedString }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedString HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt index e5542cd201..9b3955c677 100644 --- a/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -71,7 +71,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -85,8 +85,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -103,7 +102,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -128,7 +127,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -192,7 +191,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -206,8 +205,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -224,7 +222,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -249,7 +247,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test3__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -340,7 +338,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test3__string_int return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -362,8 +360,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test3__string_int }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -380,7 +377,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_Test3__string_int HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -405,7 +402,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_MethodDataSourceTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_MethodDataSourceT return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -514,8 +511,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_MethodDataSourceT }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -532,7 +528,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_MethodDataSourceT HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -557,7 +553,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_TestParameterNamePrefixBug__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -642,7 +638,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_TestParameterName return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -664,8 +660,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_TestParameterName }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -682,7 +677,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_TestParameterName HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -707,7 +702,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_PasswordTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -782,7 +777,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_PasswordTest__str return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -804,8 +799,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_PasswordTest__str }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -822,7 +816,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_PasswordTest__str HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -847,7 +841,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_SameClassConstantTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -911,7 +905,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_SameClassConstant return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -925,8 +919,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_SameClassConstant }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -943,7 +936,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_SameClassConstant HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -968,7 +961,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_DifferentClassConstantTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1032,7 +1025,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_DifferentClassCon return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1046,8 +1039,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_DifferentClassCon }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1064,7 +1056,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_DifferentClassCon HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1089,7 +1081,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CustomDisplayNameTests_NestedClassConstantTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1153,7 +1145,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_NestedClassConsta return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.CustomDisplayNameTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1167,8 +1159,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_NestedClassConsta }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1185,7 +1176,7 @@ internal sealed class TUnit_TestProject_CustomDisplayNameTests_NestedClassConsta HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt index 3992088a19..1f79ca1e5f 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -132,7 +131,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -198,7 +197,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -221,8 +220,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -239,7 +237,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_DataSource_Method__int_s HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -264,7 +262,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -323,7 +321,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -346,8 +344,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -364,7 +361,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EnumValue__TestEnum_Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -389,7 +386,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -446,7 +443,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -469,8 +466,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -487,7 +483,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NullValue__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -512,7 +508,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -569,7 +565,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -592,8 +588,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -610,7 +605,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_EmptyString__string__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -635,7 +630,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -692,7 +687,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -715,8 +710,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -733,7 +727,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_NonEmptyString__string__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -758,7 +752,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -817,7 +811,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -840,8 +834,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -858,7 +851,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_BooleanString__bool__Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -883,7 +876,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -940,7 +933,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -963,8 +956,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -981,7 +973,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_Type__Type_TestSource : HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1006,7 +998,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1063,7 +1055,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1086,8 +1078,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1104,7 +1095,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntegerArray__int___Test HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1129,7 +1120,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1186,7 +1177,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DataDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1209,8 +1200,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1227,7 +1217,7 @@ internal sealed class TUnit_TestProject_DataDrivenTests_IntMaxValue__int_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt index f8566c1769..0286bae7f4 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod_DataSourceClassCombinedW_3C180E22_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -149,7 +149,7 @@ internal sealed class TUnit_TestProject_DataSourceClassCombinedWithDataSourceMet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -175,8 +175,7 @@ internal sealed class TUnit_TestProject_DataSourceClassCombinedWithDataSourceMet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -193,7 +192,7 @@ internal sealed class TUnit_TestProject_DataSourceClassCombinedWithDataSourceMet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt index 73da974fd8..c710ef094c 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -93,7 +93,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.DataSourceGeneratorTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2])); }, @@ -119,8 +119,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -137,7 +136,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -162,7 +161,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_Method2__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -262,7 +261,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.DataSourceGeneratorTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2])); }, @@ -288,8 +287,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -306,7 +304,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -331,7 +329,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_Method3__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -431,7 +429,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.DataSourceGeneratorTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]), global::TUnit.Core.Helpers.CastHelper.Cast(args[1]), global::TUnit.Core.Helpers.CastHelper.Cast(args[2])); }, @@ -457,8 +455,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -475,7 +472,7 @@ internal sealed class TUnit_TestProject_DataSourceGeneratorTests_GeneratedData_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt index 687a23f8f0..c42eb2e30e 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AutoDataTests_Test1__string_int_double_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -84,7 +84,7 @@ internal sealed class TUnit_TestProject_AutoDataTests_Test1__string_int_double_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AutoDataTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AutoDataTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -106,8 +106,7 @@ internal sealed class TUnit_TestProject_AutoDataTests_Test1__string_int_double_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -124,7 +123,7 @@ internal sealed class TUnit_TestProject_AutoDataTests_Test1__string_int_double_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt index 2531c6cbc5..d64fec6f0b 100644 --- a/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_Transfer__decimal_decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -73,7 +73,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Transfer__decimal_d return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -95,8 +95,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Transfer__decimal_d }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -113,7 +112,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Transfer__decimal_d HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -138,7 +137,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_SimpleDecimal__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -195,7 +194,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SimpleDecimal__deci return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -217,8 +216,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SimpleDecimal__deci }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -235,7 +233,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SimpleDecimal__deci HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -260,7 +258,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_SmallDecimal__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -317,7 +315,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SmallDecimal__decim return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -339,8 +337,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SmallDecimal__decim }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -357,7 +354,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_SmallDecimal__decim HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -382,7 +379,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_MaxDecimal__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -439,7 +436,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MaxDecimal__decimal return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -461,8 +458,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MaxDecimal__decimal }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -479,7 +475,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MaxDecimal__decimal HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -504,7 +500,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_MinDecimal__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -561,7 +557,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MinDecimal__decimal return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -583,8 +579,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MinDecimal__decimal }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -601,7 +596,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MinDecimal__decimal HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -626,7 +621,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_ExplicitDecimalValue__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -683,7 +678,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_ExplicitDecimalValu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -705,8 +700,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_ExplicitDecimalValu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -723,7 +717,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_ExplicitDecimalValu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -748,7 +742,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_MultipleDecimals__decimal_decimal_decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -819,7 +813,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MultipleDecimals__d return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -841,8 +835,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MultipleDecimals__d }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -859,7 +852,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_MultipleDecimals__d HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -884,7 +877,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_Test__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -943,7 +936,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Test__decimal_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -966,8 +959,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Test__decimal_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -984,7 +976,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Test__decimal_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1009,7 +1001,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_TransactionDiscountCalculations__decimal_decima_54FB9799_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1103,7 +1095,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TransactionDiscount return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1126,8 +1118,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TransactionDiscount }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1144,7 +1135,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TransactionDiscount HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1169,7 +1160,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality3__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1226,7 +1217,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality3__decimal_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1248,8 +1239,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality3__decimal_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1266,7 +1256,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality3__decimal_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1291,7 +1281,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality4__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1348,7 +1338,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality4__decimal_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1370,8 +1360,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality4__decimal_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1388,7 +1377,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_Equality4__decimal_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1413,7 +1402,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_DecimalArgumentTests_TestMethod__decimal_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1470,7 +1459,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TestMethod__decimal return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.DecimalArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1492,8 +1481,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TestMethod__decimal }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1510,7 +1498,7 @@ internal sealed class TUnit_TestProject_DecimalArgumentTests_TestMethod__decimal HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt index 8f646e8df3..3f1e5b2fcb 100644 --- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt index 57a80528d1..1a37a733f3 100644 --- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_BasicTests_SynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -153,7 +152,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -167,8 +166,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -185,7 +183,7 @@ internal sealed class TUnit_TestProject_BasicTests_AsynchronousTest_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -210,7 +208,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -254,7 +252,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.BasicTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -268,8 +266,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -286,7 +283,7 @@ internal sealed class TUnit_TestProject_BasicTests_ValueTaskAsynchronousTest_Tes HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt index 9eb4edbbe3..f0da3a0012 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1432_EnumMemberNamesTests_SomeTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -66,7 +66,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_EnumMemberNamesTests_SomeTest return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -89,8 +89,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_EnumMemberNamesTests_SomeTest }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -107,7 +106,7 @@ internal sealed class TUnit_TestProject_Bugs__1432_EnumMemberNamesTests_SomeTest HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt index cadf5ee65b..6b8c41ef25 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -85,7 +85,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -107,8 +107,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -125,7 +124,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -150,7 +149,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -228,7 +227,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -250,8 +249,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -268,7 +266,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -293,7 +291,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -371,7 +369,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.EnumerableDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -394,8 +392,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -412,7 +409,7 @@ internal sealed class TUnit_TestProject_EnumerableDataSourceDrivenTests_DataSour HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt index 93e9d67c43..09eb157587 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_EnumerableTupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -121,7 +121,7 @@ internal sealed class TUnit_TestProject_EnumerableTupleDataSourceDrivenTests_Dat return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -144,8 +144,7 @@ internal sealed class TUnit_TestProject_EnumerableTupleDataSourceDrivenTests_Dat }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -162,7 +161,7 @@ internal sealed class TUnit_TestProject_EnumerableTupleDataSourceDrivenTests_Dat HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt index daccb82054..caf56ddf12 100644 --- a/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_TypedArguments__object_Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -83,7 +83,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_TypedArguments return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ExpectedArgumentTypeTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ExpectedArgumentTypeTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -105,8 +105,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_TypedArguments }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -123,7 +122,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_TypedArguments HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -148,7 +147,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_EnumTypes__object_Type_Type_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -226,7 +225,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_EnumTypes__obj return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ExpectedArgumentTypeTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ExpectedArgumentTypeTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -248,8 +247,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_EnumTypes__obj }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -266,7 +264,7 @@ internal sealed class TUnit_TestProject_ExpectedArgumentTypeTests_EnumTypes__obj HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt index c1786d178c..f632a0ac6f 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpectedOutput__IEnumerable_TSourc_06BD488B_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -418,8 +419,8 @@ internal sealed class TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpect } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -436,7 +437,7 @@ internal sealed class TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpect HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } 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 index c445138b59..4d2073bad5 100644 --- 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 @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] 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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -200,8 +201,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Sh } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -218,7 +219,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Sh HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -243,8 +244,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] 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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -513,8 +515,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSou } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -531,7 +533,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -556,8 +558,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] 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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -815,8 +818,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -833,7 +836,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -858,8 +861,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMeth_0AB5EDCD_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -1124,8 +1128,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1142,7 +1146,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1167,8 +1171,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] 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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -1504,8 +1509,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1522,7 +1527,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1547,8 +1552,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] 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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -1740,8 +1746,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1758,7 +1764,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1783,8 +1789,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_Should_Handle_Multiple_Type__8C0B02C5_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -1976,8 +1983,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_ } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1994,7 +2001,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -2019,8 +2026,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_Create_From_Base_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -2212,8 +2220,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_ } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -2230,7 +2238,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -2255,8 +2263,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSource_T_Should_Have_DataSource_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -2580,8 +2589,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSour } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -2598,7 +2607,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSour HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -2623,8 +2632,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWithDataSources_TClass_FullyGene_0A3B401E_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -3325,8 +3335,8 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWith } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -3343,7 +3353,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWith HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt index 3fb82263ce..6d885c506f 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_SimpleTestClass_NonGenericTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_SimpleTestClass_NonGenericTest_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.SimpleTestClass(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.SimpleTestClass(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_SimpleTestClass_NonGenericTest_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_SimpleTestClass_NonGenericTest_TestSourc HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt index ee0ab8884e..f3b68e2ec6 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -197,8 +198,8 @@ internal sealed class TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -215,7 +216,7 @@ internal sealed class TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt index 75283e8774..b856bd2d9e 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_GenericTestClass_T_TestMethod_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -197,8 +198,8 @@ internal sealed class TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -215,7 +216,7 @@ internal sealed class TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt index 758deac0b1..e292fd0ea7 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TestClass_GenericTestMethod_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -193,8 +194,8 @@ internal sealed class TUnit_TestProject_TestClass_GenericTestMethod_TestSource : } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -211,7 +212,7 @@ internal sealed class TUnit_TestProject_TestClass_GenericTestMethod_TestSource : HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt index d809263f3c..fa3b79bed8 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -197,8 +198,8 @@ internal sealed class TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_T } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -215,7 +216,7 @@ internal sealed class TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_T HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt index d0bb344970..7610fd5733 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NestedGenericTestClass_T_TestMethod_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -197,8 +198,8 @@ internal sealed class TUnit_TestProject_NestedGenericTestClass_T_TestMethod_Test } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -215,7 +216,7 @@ internal sealed class TUnit_TestProject_NestedGenericTestClass_T_TestMethod_Test HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt index c2c5b57fbe..0da7af9a9e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -67,7 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1589.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -84,8 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -102,7 +101,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt index 996c00eaa9..e1f3db50a7 100644 --- a/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -67,7 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1594.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -85,8 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -103,7 +102,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt index b9c7e74bb7..123acfb153 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt @@ -21,7 +21,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref string GetProperty7BackingField(global::TUnit.TestProject.PropertySetterTests instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -312,7 +312,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PropertySetterTests() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PropertySetterTests() { Property1 = default!, Property2 = default!, @@ -335,8 +335,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -353,7 +352,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -392,7 +391,7 @@ internal sealed class TUnit_TestProject_InheritedPropertySetterTests_Test_TestSo [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref string GetProperty7BackingField(global::TUnit.TestProject.PropertySetterTests instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -578,7 +577,7 @@ internal sealed class TUnit_TestProject_InheritedPropertySetterTests_Test_TestSo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedPropertySetterTests() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedPropertySetterTests() { Property1 = default!, Property2 = default!, @@ -601,8 +600,7 @@ internal sealed class TUnit_TestProject_InheritedPropertySetterTests_Test_TestSo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -619,7 +617,7 @@ internal sealed class TUnit_TestProject_InheritedPropertySetterTests_Test_TestSo HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt index 5a9caf8959..58855ad1ce 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_Test_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -54,7 +54,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -69,8 +69,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -87,7 +86,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -112,7 +111,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_GenericMethodDataSource__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -171,7 +170,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -194,8 +193,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -212,7 +210,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -237,7 +235,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_NonGenericMethodDataSource__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -307,7 +305,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -330,8 +328,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -348,7 +345,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -373,7 +370,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_VerifyInheritedCategoriesAreAvailable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -420,7 +417,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -434,8 +431,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -452,7 +448,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -477,7 +473,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -525,7 +521,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -540,8 +536,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -558,7 +553,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -583,7 +578,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTestWithMultipleCategories_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -632,7 +627,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -647,8 +642,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -665,7 +659,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt index 66defbf2bf..8aac896da7 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_SecondTest_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -157,7 +156,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass2(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -171,8 +170,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -189,7 +187,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -214,7 +212,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -259,7 +257,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AbstractTests.ConcreteClass1(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -273,8 +271,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -291,7 +288,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt index 029d5ef8ea..9602a729d1 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt @@ -11,7 +11,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_BaseClass_Test__int_Test [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref global::TUnit.TestProject.Bugs._1924.DataClass GetDataBackingField(global::TUnit.TestProject.Bugs._1924.None.BaseClass instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -116,7 +116,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_BaseClass_Test__int_Test return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.BaseClass() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.BaseClass() { Data = default!, }, @@ -141,8 +141,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_BaseClass_Test__int_Test }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -159,7 +158,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_BaseClass_Test__int_Test HasDataSource = true, RepeatCount = 10, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -188,7 +187,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSour [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref global::TUnit.TestProject.Bugs._1924.DataClass GetDataBackingField(global::TUnit.TestProject.Bugs._1924.None.BaseClass instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -276,7 +275,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests() { Data = default!, }, @@ -301,8 +300,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -319,7 +317,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSour HasDataSource = true, RepeatCount = 10, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -348,7 +346,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSou [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref global::TUnit.TestProject.Bugs._1924.DataClass GetDataBackingField(global::TUnit.TestProject.Bugs._1924.None.BaseClass instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -436,7 +434,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests2() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests2() { Data = default!, }, @@ -461,8 +459,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -479,7 +476,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSou HasDataSource = true, RepeatCount = 10, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -508,7 +505,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSou [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref global::TUnit.TestProject.Bugs._1924.DataClass GetDataBackingField(global::TUnit.TestProject.Bugs._1924.None.BaseClass instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -596,7 +593,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests3() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1924.None.Tests3() { Data = default!, }, @@ -621,8 +618,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -639,7 +635,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSou HasDataSource = true, RepeatCount = 10, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt index 815c21dd14..1c1063e143 100644 --- a/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__Issue2887_ActualTestClass_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -61,7 +61,7 @@ internal sealed class TUnit_TestProject_Bugs__Issue2887_ActualTestClass_Test1_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { // ClassConstructor attribute is present - instance creation handled at runtime throw new global::System.NotSupportedException("Instance creation for classes with ClassConstructor attribute is handled at runtime"); @@ -80,8 +80,7 @@ internal sealed class TUnit_TestProject_Bugs__Issue2887_ActualTestClass_Test1_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -98,7 +97,7 @@ internal sealed class TUnit_TestProject_Bugs__Issue2887_ActualTestClass_Test1_Te HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt index 39404ff175..de4b2c7f25 100644 --- a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -100,8 +100,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -118,7 +117,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_One__string_int_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -143,7 +142,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -221,7 +220,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -243,8 +242,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -261,7 +259,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Two__int_int_int_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -286,7 +284,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnum_TestEnum__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -357,7 +355,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -379,8 +377,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -397,7 +394,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixTest_Enum__int_TestEnu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -422,7 +419,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -486,7 +483,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -508,8 +505,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -526,7 +522,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools__string_bo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -551,7 +547,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_bool__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -615,7 +611,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -637,8 +633,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -655,7 +650,7 @@ internal sealed class TUnit_TestProject_MatrixTests_AutoGenerateBools2__string_b HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -680,7 +675,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_TestEnum__TestEnum2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -744,7 +739,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -766,8 +761,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -784,7 +778,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ImplicitConversion__OneOf_Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -809,7 +803,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrixValues__CountToTenEnum_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -873,7 +867,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -895,8 +889,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -913,7 +906,7 @@ internal sealed class TUnit_TestProject_MatrixTests_ExcludingAutoGeneratedMatrix HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -938,7 +931,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method1__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -995,7 +988,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1017,8 +1010,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1035,7 +1027,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method1__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1060,7 +1052,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1117,7 +1109,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1139,8 +1131,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1157,7 +1148,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method2__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1182,7 +1173,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1239,7 +1230,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1261,8 +1252,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1279,7 +1269,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method3__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1304,7 +1294,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1361,7 +1351,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1383,8 +1373,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1401,7 +1390,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Method4__int_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1426,7 +1415,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1493,7 +1482,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1515,8 +1504,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1533,7 +1521,7 @@ internal sealed class TUnit_TestProject_MatrixTests_Exclusion__int_int_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1558,7 +1546,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParameter_UsesOnlyMethodValues__boo_38BEEE8F_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1622,7 +1610,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MatrixTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1644,8 +1632,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1662,7 +1649,7 @@ internal sealed class TUnit_TestProject_MatrixTests_MatrixMethod_WithEnumParamet HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt index e736239c19..39f104fc47 100644 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method2__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -209,7 +208,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -232,8 +231,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -250,7 +248,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -275,7 +273,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method_WithAction__Action_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -343,7 +341,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -366,8 +364,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -384,7 +381,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -409,7 +406,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method3__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -492,7 +489,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -515,8 +512,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -533,7 +529,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -558,7 +554,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_Method4__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -668,7 +664,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -691,8 +687,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -709,7 +704,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_M HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -734,7 +729,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_WithBaseReturn__BaseValue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -802,7 +797,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -825,8 +820,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -843,7 +837,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_DataSource_W HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -868,7 +862,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFuncArrayTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -946,7 +940,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -968,8 +962,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -986,7 +979,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenTests_EnumerableFu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt index d31124f197..30be7bda96 100644 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests_MyTest__int_Cancell_DF7AA95A_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -183,7 +183,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenWithCancellationTo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -207,8 +207,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenWithCancellationTo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -225,7 +224,7 @@ internal sealed class TUnit_TestProject_MethodDataSourceDrivenWithCancellationTo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt index 321021d4cc..e62975e0fe 100644 --- a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -95,7 +95,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test1 return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(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])); }, @@ -113,8 +113,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test1 }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -131,7 +130,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test1 HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -156,7 +155,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -244,7 +243,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test2 return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(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])); }, @@ -262,8 +261,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test2 }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -280,7 +278,7 @@ internal sealed class TUnit_TestProject_MultipleClassDataSourceDrivenTests_Test2 HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt index c770d4a295..a6c73f21d0 100644 --- a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NameOfArgumentTests_TestName__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_NameOfArgumentTests_TestName__string_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NameOfArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NameOfArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_NameOfArgumentTests_TestName__string_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_NameOfArgumentTests_TestName__string_Tes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt index d9299fac67..25c61f5ba1 100644 --- a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test__byte__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -65,7 +65,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test__byte__Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NullableByteArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NullableByteArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -88,8 +88,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test__byte__Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -106,7 +105,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test__byte__Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -131,7 +130,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test2__byte_byte__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -196,7 +195,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test2__byte_by return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NullableByteArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NullableByteArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -219,8 +218,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test2__byte_by }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -237,7 +235,7 @@ internal sealed class TUnit_TestProject_NullableByteArgumentTests_Test2__byte_by HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt index 4aa20125cd..f589df6ccc 100644 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Int__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -87,8 +87,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -105,7 +104,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -130,7 +129,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -187,7 +186,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -210,8 +209,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -228,7 +226,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -253,7 +251,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -310,7 +308,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -333,8 +331,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -351,7 +348,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -376,7 +373,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -433,7 +430,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -456,8 +453,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -474,7 +470,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -499,7 +495,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -556,7 +552,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -579,8 +575,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -597,7 +592,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -622,7 +617,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -679,7 +674,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -702,8 +697,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -720,7 +714,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt index 4aa20125cd..f589df6ccc 100644 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Int__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -87,8 +87,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -105,7 +104,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Int__int_TestSource HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -130,7 +129,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -187,7 +186,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -210,8 +209,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -228,7 +226,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Double__double_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -253,7 +251,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -310,7 +308,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -333,8 +331,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -351,7 +348,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Float__float_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -376,7 +373,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -433,7 +430,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -456,8 +453,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -474,7 +470,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_Long__long_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -499,7 +495,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -556,7 +552,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -579,8 +575,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -597,7 +592,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_ULong__ulong_TestSou HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -622,7 +617,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -679,7 +674,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.NumberArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -702,8 +697,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -720,7 +714,7 @@ internal sealed class TUnit_TestProject_NumberArgumentTests_UInt__uint_TestSourc HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt index 5c27b9710e..b9c22f0a81 100644 --- a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_High_1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -52,7 +52,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -109,7 +108,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_High_2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -154,7 +153,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_2_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -168,8 +167,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_2_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -186,7 +184,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_2_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -211,7 +209,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_High_3_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -256,7 +254,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_3_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -270,8 +268,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_3_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -288,7 +285,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_High_3_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -313,7 +310,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -358,7 +355,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_1_TestSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -372,8 +369,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_1_TestSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -390,7 +386,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_1_TestSour HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -415,7 +411,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_2_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -460,7 +456,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_2_TestSour return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -474,8 +470,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_2_TestSour }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -492,7 +487,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Medium_2_TestSour HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -517,7 +512,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_PriorityFilteringTests_Low_1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -562,7 +557,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Low_1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PriorityFilteringTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -576,8 +571,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Low_1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -594,7 +588,7 @@ internal sealed class TUnit_TestProject_PriorityFilteringTests_Low_1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt index 8db4720ad9..12e9e87252 100644 --- a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt @@ -21,7 +21,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl [global::System.Runtime.CompilerServices.UnsafeAccessor(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Field, Name = "k__BackingField")] private static extern ref string GetProperty7BackingField(global::TUnit.TestProject.PropertySetterTests instance); #endif - public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -312,7 +312,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.PropertySetterTests() + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.PropertySetterTests() { Property1 = default!, Property2 = default!, @@ -335,8 +335,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -353,7 +352,7 @@ internal sealed class TUnit_TestProject_PropertySetterTests_Test_TestSource : gl HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt index d98b2ae554..51bf68a273 100644 --- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithAssemblyRepeat_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithAssemblyRepe return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AssemblyRepeatTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AssemblyRepeatTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithAssemblyRepe }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithAssemblyRepe HasDataSource = false, RepeatCount = 3, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithMethodRepeatOverride_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -158,7 +157,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithMethodRepeat return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AssemblyRepeatTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AssemblyRepeatTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -173,8 +172,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithMethodRepeat }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -191,7 +189,7 @@ internal sealed class TUnit_TestProject_AssemblyRepeatTests_TestWithMethodRepeat HasDataSource = false, RepeatCount = 1, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt index 72f177340c..eb3105ea86 100644 --- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_RepeatTests_One_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -55,7 +55,7 @@ internal sealed class TUnit_TestProject_RepeatTests_One_TestSource : global::TUn return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -70,8 +70,7 @@ internal sealed class TUnit_TestProject_RepeatTests_One_TestSource : global::TUn }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -88,7 +87,7 @@ internal sealed class TUnit_TestProject_RepeatTests_One_TestSource : global::TUn HasDataSource = false, RepeatCount = 1, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -113,7 +112,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_RepeatTests_Two_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -161,7 +160,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Two_TestSource : global::TUn return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -176,8 +175,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Two_TestSource : global::TUn }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -194,7 +192,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Two_TestSource : global::TUn HasDataSource = false, RepeatCount = 2, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -219,7 +217,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_RepeatTests_Three_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -266,7 +264,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Three_TestSource : global::T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.RepeatTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -281,8 +279,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Three_TestSource : global::T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -299,7 +296,7 @@ internal sealed class TUnit_TestProject_RepeatTests_Three_TestSource : global::T HasDataSource = false, RepeatCount = 3, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt index bc6e19c570..fdd908b1b6 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_With_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -57,7 +57,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -71,8 +71,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -89,7 +88,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -114,7 +113,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -163,7 +162,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -177,8 +176,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -195,7 +193,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -220,7 +218,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -270,7 +268,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -284,8 +282,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -302,7 +299,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -327,7 +324,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -377,7 +374,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -391,8 +388,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -409,7 +405,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -434,7 +430,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTrue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -484,7 +480,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -498,8 +494,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -516,7 +511,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -541,7 +536,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -591,7 +586,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -605,8 +600,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -623,7 +617,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -648,7 +642,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -698,7 +692,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -712,8 +706,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -730,7 +723,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -755,7 +748,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -805,7 +798,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -819,8 +812,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -837,7 +829,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -862,7 +854,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -912,7 +904,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -926,8 +918,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -944,7 +935,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -969,7 +960,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1019,7 +1010,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1033,8 +1024,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1051,7 +1041,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1076,7 +1066,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1126,7 +1116,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1140,8 +1130,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1158,7 +1147,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1183,7 +1172,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1233,7 +1222,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1247,8 +1236,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1265,7 +1253,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1290,7 +1278,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1340,7 +1328,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1354,8 +1342,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1372,7 +1359,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1397,7 +1384,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1447,7 +1434,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1461,8 +1448,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1479,7 +1465,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1504,7 +1490,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1554,7 +1540,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1568,8 +1554,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1586,7 +1571,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt index bc6e19c570..fdd908b1b6 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_With_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -57,7 +57,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -71,8 +71,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -89,7 +88,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -114,7 +113,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -163,7 +162,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -177,8 +176,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -195,7 +193,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -220,7 +218,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -270,7 +268,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -284,8 +282,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -302,7 +299,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -327,7 +324,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -377,7 +374,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -391,8 +388,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -409,7 +405,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -434,7 +430,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTrue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -484,7 +480,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -498,8 +494,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -516,7 +511,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -541,7 +536,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -591,7 +586,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -605,8 +600,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -623,7 +617,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -648,7 +642,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -698,7 +692,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -712,8 +706,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -730,7 +723,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -755,7 +748,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -805,7 +798,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -819,8 +812,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -837,7 +829,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -862,7 +854,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -912,7 +904,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -926,8 +918,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -944,7 +935,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -969,7 +960,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1019,7 +1010,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1033,8 +1024,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1051,7 +1041,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1076,7 +1066,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1126,7 +1116,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1140,8 +1130,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1158,7 +1147,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1183,7 +1172,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1233,7 +1222,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1247,8 +1236,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1265,7 +1253,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1290,7 +1278,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1340,7 +1328,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1354,8 +1342,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1372,7 +1359,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1397,7 +1384,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1447,7 +1434,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1461,8 +1448,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1479,7 +1465,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1504,7 +1490,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1554,7 +1540,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1568,8 +1554,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1586,7 +1571,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt index bc6e19c570..fdd908b1b6 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_With_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -57,7 +57,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -71,8 +71,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -89,7 +88,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -114,7 +113,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -163,7 +162,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -177,8 +176,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -195,7 +193,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -220,7 +218,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -270,7 +268,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -284,8 +282,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -302,7 +299,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -327,7 +324,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -377,7 +374,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -391,8 +388,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -409,7 +405,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -434,7 +430,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTrue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -484,7 +480,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -498,8 +494,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -516,7 +511,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -541,7 +536,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -591,7 +586,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -605,8 +600,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -623,7 +617,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -648,7 +642,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -698,7 +692,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -712,8 +706,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -730,7 +723,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -755,7 +748,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -805,7 +798,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -819,8 +812,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -837,7 +829,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -862,7 +854,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -912,7 +904,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -926,8 +918,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -944,7 +935,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -969,7 +960,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1019,7 +1010,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1033,8 +1024,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1051,7 +1041,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1076,7 +1066,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1126,7 +1116,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1140,8 +1130,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1158,7 +1147,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1183,7 +1172,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1233,7 +1222,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1247,8 +1236,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1265,7 +1253,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1290,7 +1278,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1340,7 +1328,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1354,8 +1342,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1372,7 +1359,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1397,7 +1384,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1447,7 +1434,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1461,8 +1448,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1479,7 +1465,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1504,7 +1490,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1554,7 +1540,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1568,8 +1554,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1586,7 +1571,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt index 54aea6040c..9c132d71b3 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_With_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -57,7 +57,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -71,8 +71,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -89,7 +88,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_With_STA_TestSource : glo HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -114,7 +113,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -163,7 +162,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -177,8 +176,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -195,7 +193,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_Without_STA_TestSource : HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -220,7 +218,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -270,7 +268,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -284,8 +282,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -302,7 +299,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithSimpleAwait_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -327,7 +324,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -377,7 +374,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -391,8 +388,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -409,7 +405,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskYield_TestSou HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -434,7 +430,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTrue_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -484,7 +480,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -498,8 +494,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -516,7 +511,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithConfigureAwaitTru HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -541,7 +536,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -591,7 +586,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -605,8 +600,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -623,7 +617,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithNestedAsyncCalls_ HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -648,7 +642,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -698,7 +692,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -712,8 +706,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -730,7 +723,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskFromResult_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -755,7 +748,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -805,7 +798,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -819,8 +812,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -837,7 +829,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithCompletedTask_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -862,7 +854,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -912,7 +904,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -926,8 +918,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -944,7 +935,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskRun_TestSourc HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -969,7 +960,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1019,7 +1010,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1033,8 +1024,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1051,7 +1041,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithMultipleAwaits_Te HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1076,7 +1066,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1126,7 +1116,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1140,8 +1130,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1158,7 +1147,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithAsyncEnumerable_T HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1183,7 +1172,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1233,7 +1222,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1247,8 +1236,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1265,7 +1253,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithTaskWhenAll_TestS HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1290,7 +1278,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1340,7 +1328,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1354,8 +1342,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1372,7 +1359,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithExceptionHandling HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1397,7 +1384,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1447,7 +1434,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1461,8 +1448,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1479,7 +1465,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithThrowsNothingAsse HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1504,7 +1490,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1554,7 +1540,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.STAThreadTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -1568,8 +1554,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1586,7 +1571,7 @@ internal sealed class TUnit_TestProject_STAThreadTests_STA_WithFuncAssertion_Tes HasDataSource = false, RepeatCount = 100, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt index f6bcc73497..0d4fa0e455 100644 --- a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_StringArgumentTests_Normal__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Normal__string_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.StringArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.StringArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Normal__string_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Normal__string_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_StringArgumentTests_Nullable__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -205,7 +204,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Nullable__string__Te return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.StringArgumentTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.StringArgumentTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -228,8 +227,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Nullable__string__Te }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -246,7 +244,7 @@ internal sealed class TUnit_TestProject_StringArgumentTests_Nullable__string__Te HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt index fb0dd0297b..e34ac2c1a1 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_InvalidString_ReturnsFailure__string__Canc_9F7FA274_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -75,7 +75,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_InvalidString_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -98,8 +98,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_InvalidString_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -116,7 +115,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_InvalidString_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -141,7 +140,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1304_Tests_Parse_InvalidString_ThrowsException__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -202,7 +201,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_Parse_InvalidString_Thr return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -224,8 +223,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_Parse_InvalidString_Thr }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -242,7 +240,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_Parse_InvalidString_Thr HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -267,7 +265,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_ValidString_ReturnsAccountId__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -325,7 +323,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_ValidString_Re return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1304.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -347,8 +345,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_ValidString_Re }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -365,7 +362,7 @@ internal sealed class TUnit_TestProject_Bugs__1304_Tests_TryParse_ValidString_Re HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt index 672dffc6d6..f46e5a1216 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1538_Tests_Eight_Args__bool_string__string__string__string__st_35276EED_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -134,7 +134,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_Eight_Args__bool_string return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1538.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1538.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -157,8 +157,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_Eight_Args__bool_string }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -175,7 +174,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_Eight_Args__bool_string HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -200,7 +199,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1538_Tests_SixteenArgs__bool_string__string__string__string__s_972B9C97_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -383,7 +382,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_SixteenArgs__bool_strin return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1538.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1538.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -406,8 +405,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_SixteenArgs__bool_strin }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -424,7 +422,7 @@ internal sealed class TUnit_TestProject_Bugs__1538_Tests_SixteenArgs__bool_strin HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt index d6a447983b..4551490733 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1539_Tests_Test_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -56,7 +56,7 @@ internal sealed class TUnit_TestProject_Bugs__1539_Tests_Test_TestSource : globa return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1539.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1539.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -71,8 +71,7 @@ internal sealed class TUnit_TestProject_Bugs__1539_Tests_Test_TestSource : globa }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -89,7 +88,7 @@ internal sealed class TUnit_TestProject_Bugs__1539_Tests_Test_TestSource : globa HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt index c2c5b57fbe..0da7af9a9e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -67,7 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1589.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -84,8 +84,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -102,7 +101,7 @@ internal sealed class TUnit_TestProject_Bugs__1589_MyTests_Test1_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt index 996c00eaa9..e1f3db50a7 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -67,7 +67,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1594.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -85,8 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -103,7 +102,7 @@ internal sealed class TUnit_TestProject_Bugs__1594_MyTests_Test1_TestSource : gl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt index 84bc932262..57ac1a6fac 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1603_Tests_Casted_Integer_To_Short_Converts__short_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Casted_Integer_To_Short return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1603.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1603.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Casted_Integer_To_Short }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Casted_Integer_To_Short HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -129,7 +128,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1603_Tests_Integer_To_Short_Converts__short_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -186,7 +185,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Integer_To_Short_Conver return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1603.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1603.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -208,8 +207,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Integer_To_Short_Conver }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -226,7 +224,7 @@ internal sealed class TUnit_TestProject_Bugs__1603_Tests_Integer_To_Short_Conver HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt index 5883e552a2..61a0b1067d 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1692_Tests_NullTest__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -65,7 +65,7 @@ internal sealed class TUnit_TestProject_Bugs__1692_Tests_NullTest__string__TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1692.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1692.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -87,8 +87,7 @@ internal sealed class TUnit_TestProject_Bugs__1692_Tests_NullTest__string__TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -105,7 +104,7 @@ internal sealed class TUnit_TestProject_Bugs__1692_Tests_NullTest__string__TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt index de4b8bccd5..8b7778499a 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1821_Tests_MethodDataSource__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -77,7 +77,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MethodDataSource__strin return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1821.Tests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -102,8 +102,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MethodDataSource__strin }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -120,7 +119,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MethodDataSource__strin HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -145,7 +144,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1821_Tests_MatrixDataSource__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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -215,7 +214,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MatrixDataSource__strin return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.Bugs._1821.Tests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -240,8 +239,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MatrixDataSource__strin }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -258,7 +256,7 @@ internal sealed class TUnit_TestProject_Bugs__1821_Tests_MatrixDataSource__strin HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt index e9d4ec7f50..20bb1ed8d1 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -169,7 +168,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -192,8 +191,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -210,7 +208,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -235,7 +233,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -294,7 +292,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -317,8 +315,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -335,7 +332,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt index e9d4ec7f50..20bb1ed8d1 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -169,7 +168,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -192,8 +191,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -210,7 +208,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -235,7 +233,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -294,7 +292,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -317,8 +315,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -335,7 +332,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt index e9d4ec7f50..20bb1ed8d1 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -169,7 +168,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -192,8 +191,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -210,7 +208,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -235,7 +233,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -294,7 +292,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -317,8 +315,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -335,7 +332,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt index 21848a6632..e0804527cb 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -111,7 +110,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -169,7 +168,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -192,8 +191,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -210,7 +208,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -235,7 +233,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -294,7 +292,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1889.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -317,8 +315,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -335,7 +332,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt index a3151c3e5b..e63f1540af 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -53,7 +53,7 @@ internal sealed class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._1899.DerivedTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._1899.DerivedTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -68,8 +68,7 @@ internal sealed class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -86,7 +85,7 @@ internal sealed class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt index c0d242bb52..84311dc61e 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2083_Tests_MyTest__long_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -69,7 +69,7 @@ internal sealed class TUnit_TestProject_Bugs__2083_Tests_MyTest__long_TestSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2083.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2083.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -92,8 +92,7 @@ internal sealed class TUnit_TestProject_Bugs__2083_Tests_MyTest__long_TestSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -110,7 +109,7 @@ internal sealed class TUnit_TestProject_Bugs__2083_Tests_MyTest__long_TestSource HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt index 78967c0eaf..6e228a0596 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2085_Tests_Double_SpecialConsts__double_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -64,7 +64,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Double_SpecialConsts__d return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2085.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2085.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -86,8 +86,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Double_SpecialConsts__d }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -104,7 +103,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Double_SpecialConsts__d HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -129,7 +128,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2085_Tests_Float_SpecialConsts__float_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -186,7 +185,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Float_SpecialConsts__fl return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2085.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2085.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -208,8 +207,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Float_SpecialConsts__fl }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -226,7 +224,7 @@ internal sealed class TUnit_TestProject_Bugs__2085_Tests_Float_SpecialConsts__fl HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt index dec7e13f5c..cd23e7d64f 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test__int_long___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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -72,7 +72,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test__int_long___TestSo return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2112.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2112.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -125,8 +125,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test__int_long___TestSo }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -143,7 +142,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test__int_long___TestSo HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -168,7 +167,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test2__int_long___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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -233,7 +232,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test2__int_long___TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.Bugs._2112.Tests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.Bugs._2112.Tests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -286,8 +285,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test2__int_long___TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -304,7 +302,7 @@ internal sealed class TUnit_TestProject_Bugs__2112_Tests_Test2__int_long___TestS HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt index 4ec2fa9e64..131dfbecc2 100644 --- a/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt @@ -1,4 +1,4 @@ -// +// #pragma warning disable #nullable enable @@ -7,8 +7,9 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { + var __results = new global::System.Collections.Generic.List(); // Create generic metadata with concrete type registrations var genericMetadata = new global::TUnit.Core.GenericTestMetadata { @@ -498,8 +499,8 @@ internal sealed class TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T } }; genericMetadata.TestSessionId = testSessionId; - yield return genericMetadata; - yield break; + __results.Add(genericMetadata); + return __results; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -516,7 +517,7 @@ internal sealed class TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt index 22b83b7c2b..bb9d5662f0 100644 --- a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DefaultTest__CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -96,7 +96,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DefaultTes return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -113,8 +113,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DefaultTes }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -131,7 +130,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DefaultTes HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -156,7 +155,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_BasicTest__CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -247,7 +246,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_BasicTest_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -264,8 +263,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_BasicTest_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -282,7 +280,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_BasicTest_ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -307,7 +305,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_InheritedTimeoutAttribute__CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -397,7 +395,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_InheritedT return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -414,8 +412,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_InheritedT }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -432,7 +429,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_InheritedT HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -457,7 +454,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataTest__int_CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -557,7 +554,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataTest__ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -583,8 +580,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataTest__ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -601,7 +597,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataTest__ HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -626,7 +622,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataSourceTest__int_CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -747,7 +743,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataSource return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -773,8 +769,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataSource }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -791,7 +786,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_DataSource HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -816,7 +811,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_MatrixTest__int_CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -917,7 +912,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_MatrixTest return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -943,8 +938,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_MatrixTest }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -961,7 +955,7 @@ internal sealed class TUnit_TestProject_TimeoutCancellationTokenTests_MatrixTest HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -986,7 +980,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TimeoutDoesNotFireTests_QuickTestDoesNotTimeout__CancellationToken_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1076,7 +1070,7 @@ internal sealed class TUnit_TestProject_TimeoutDoesNotFireTests_QuickTestDoesNot return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.TimeoutDoesNotFireTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -1093,8 +1087,7 @@ internal sealed class TUnit_TestProject_TimeoutDoesNotFireTests_QuickTestDoesNot }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1111,7 +1104,7 @@ internal sealed class TUnit_TestProject_TimeoutDoesNotFireTests_QuickTestDoesNot HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } @@ -1136,7 +1129,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_CancellationTokenTriggeredTests_CancellationTokenIsTriggered__Cancel_38B13F70_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -1226,7 +1219,7 @@ internal sealed class TUnit_TestProject_CancellationTokenTriggeredTests_Cancella return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => + InstanceFactory = static (typeArgs, args) => { return new global::TUnit.TestProject.CancellationTokenTriggeredTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0])); }, @@ -1243,8 +1236,7 @@ internal sealed class TUnit_TestProject_CancellationTokenTriggeredTests_Cancella }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -1261,7 +1253,7 @@ internal sealed class TUnit_TestProject_CancellationTokenTriggeredTests_Cancella HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt index ccf119c861..80318b84bc 100644 --- a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_TupleMethod__int_string_bool_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -89,7 +89,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TupleDataSourceDrivenTests(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -112,8 +112,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -130,7 +129,7 @@ internal sealed class TUnit_TestProject_TupleDataSourceDrivenTests_DataSource_Tu HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt index 711d0e8981..f975995e9d 100644 --- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_AotDataSourceTest_TestWithDataSource__int_int_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -78,7 +78,7 @@ internal sealed class TUnit_TestProject_AotDataSourceTest_TestWithDataSource__in return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.AotDataSourceTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.AotDataSourceTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -101,8 +101,7 @@ internal sealed class TUnit_TestProject_AotDataSourceTest_TestWithDataSource__in }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -119,7 +118,7 @@ internal sealed class TUnit_TestProject_AotDataSourceTest_TestWithDataSource__in HasDataSource = true, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt index 3cd62b4cd0..9cd5a28a5a 100644 --- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ConfigurationTest_TestWithConfiguration_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_ConfigurationTest_TestWithConfiguration_ return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ConfigurationTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ConfigurationTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_ConfigurationTest_TestWithConfiguration_ }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_ConfigurationTest_TestWithConfiguration_ HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt index 94b5380612..151de011a0 100644 --- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_ModuleInitializerTest_TestWithModuleInit_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_ModuleInitializerTest_TestWithModuleInit return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.ModuleInitializerTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.ModuleInitializerTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_ModuleInitializerTest_TestWithModuleInit }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_ModuleInitializerTest_TestWithModuleInit HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt index 1a2241bbb2..17a944edf6 100644 --- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt @@ -7,7 +7,7 @@ namespace TUnit.Generated; [global::System.CodeDom.Compiler.GeneratedCode("TUnit", "1.0.0.0")] internal sealed class TUnit_TestProject_TypedDelegateTest_TestWithDelegate_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) + public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId) { var metadata = new global::TUnit.Core.TestMetadata { @@ -51,7 +51,7 @@ internal sealed class TUnit_TestProject_TypedDelegateTest_TestWithDelegate_TestS return classMetadata; }) }, - InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.TypedDelegateTest(), + InstanceFactory = static (typeArgs, args) => new global::TUnit.TestProject.TypedDelegateTest(), InvokeTypedTest = static (instance, args, cancellationToken) => { try @@ -66,8 +66,7 @@ internal sealed class TUnit_TestProject_TypedDelegateTest_TestWithDelegate_TestS }, }; metadata.UseRuntimeDataGeneration(testSessionId); - yield return metadata; - yield break; + return new global::TUnit.Core.TestMetadata[] { metadata }; } public global::System.Collections.Generic.IEnumerable EnumerateTestDescriptors() { @@ -84,7 +83,7 @@ internal sealed class TUnit_TestProject_TypedDelegateTest_TestWithDelegate_TestS HasDataSource = false, RepeatCount = 0, DependsOn = global::System.Array.Empty(), - Materializer = GetTestsAsync + Materializer = GetTests }; } } diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/InstanceFactoryGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/InstanceFactoryGenerator.cs index ccc4f8d02d..19e041f38b 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/InstanceFactoryGenerator.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/InstanceFactoryGenerator.cs @@ -28,7 +28,7 @@ public static bool HasClassConstructorAttribute(INamedTypeSymbol namedTypeSymbol /// public static void GenerateClassConstructorStub(CodeWriter writer) { - writer.AppendLine("InstanceFactory = (typeArgs, args) =>"); + writer.AppendLine("InstanceFactory = static (typeArgs, args) =>"); writer.AppendLine("{"); writer.Indent(); writer.AppendLine("// ClassConstructor attribute is present - instance creation handled at runtime"); @@ -111,11 +111,11 @@ public static void GenerateInstanceFactory(CodeWriter writer, ITypeSymbol typeSy if (!requiredProperties.Any()) { - writer.AppendLine($"InstanceFactory = (typeArgs, args) => new {className}(),"); + writer.AppendLine($"InstanceFactory = static (typeArgs, args) => new {className}(),"); } else { - writer.AppendLine($"InstanceFactory = (typeArgs, args) => new {className}()"); + writer.AppendLine($"InstanceFactory = static (typeArgs, args) => new {className}()"); writer.AppendLine("{"); writer.Indent(); @@ -163,7 +163,7 @@ public static void GenerateInstanceFactory(CodeWriter writer, ITypeSymbol typeSy private static void GenerateTypedConstructorCall(CodeWriter writer, string className, IMethodSymbol constructor) { - writer.AppendLine("InstanceFactory = (typeArgs, args) =>"); + writer.AppendLine("InstanceFactory = static (typeArgs, args) =>"); writer.AppendLine("{"); writer.Indent(); @@ -223,7 +223,7 @@ private static void GenerateTypedConstructorCall(CodeWriter writer, string class private static void GenerateGenericInstanceFactory(CodeWriter writer, INamedTypeSymbol genericType) { - writer.AppendLine("InstanceFactory = (typeArgs, args) =>"); + writer.AppendLine("InstanceFactory = static (typeArgs, args) =>"); writer.AppendLine("{"); writer.Indent(); diff --git a/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs b/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs index bd4cfc51dd..73702998d6 100644 --- a/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs +++ b/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs @@ -327,14 +327,17 @@ private static void GenerateTestMetadata(CodeWriter writer, TestMethodMetadata t GenerateReflectionFieldAccessors(writer, testMethod.TypeSymbol); - writer.AppendLine("public async global::System.Collections.Generic.IAsyncEnumerable GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)"); + writer.AppendLine("public global::System.Collections.Generic.IReadOnlyList GetTests(string testSessionId)"); writer.AppendLine("{"); writer.Indent(); - writer.AppendLine(); + var needsList = testMethod.IsGenericType || testMethod is { IsGenericMethod: true, MethodSymbol.TypeParameters.Length: > 0 }; - if (testMethod.IsGenericType || testMethod is { IsGenericMethod: true, MethodSymbol.TypeParameters.Length: > 0 }) + if (needsList) { + writer.AppendLine("var __results = new global::System.Collections.Generic.List();"); + writer.AppendLine(); + var hasTypedDataSource = testMethod.MethodAttributes .Any(a => DataSourceAttributeHelper.IsDataSourceAttribute(a.AttributeClass) && InferTypesFromDataSourceAttribute(testMethod.MethodSymbol, a) != null); @@ -373,13 +376,14 @@ private static void GenerateTestMetadata(CodeWriter writer, TestMethodMetadata t // GenericTestMetadata that the engine will fail with a clear error message GenerateTestMetadataInstance(writer, testMethod, className); } + + writer.AppendLine("return __results;"); } else { - GenerateTestMetadataInstance(writer, testMethod, className); + GenerateTestMetadataInstance(writer, testMethod, className, addToResultsList: false); + writer.AppendLine("return new global::TUnit.Core.TestMetadata[] { metadata };"); } - - writer.AppendLine("yield break;"); writer.Unindent(); writer.AppendLine("}"); @@ -394,7 +398,7 @@ private static void GenerateTestMetadata(CodeWriter writer, TestMethodMetadata t GenerateModuleInitializer(writer, testMethod, uniqueClassName); } - private static void GenerateTestMetadataInstance(CodeWriter writer, TestMethodMetadata testMethod, string className) + private static void GenerateTestMetadataInstance(CodeWriter writer, TestMethodMetadata testMethod, string className, bool addToResultsList = true) { var methodName = testMethod.MethodSymbol.Name; @@ -444,7 +448,10 @@ private static void GenerateTestMetadataInstance(CodeWriter writer, TestMethodMe writer.AppendLine("metadata.TestSessionId = testSessionId;"); } - writer.AppendLine("yield return metadata;"); + if (addToResultsList) + { + writer.AppendLine("__results.Add(metadata);"); + } } private static void GenerateMetadata(CodeWriter writer, TestMethodMetadata testMethod) @@ -1984,7 +1991,7 @@ private static void GenerateEnumerateTestDescriptors(CodeWriter writer, TestMeth writer.AppendLine($"HasDataSource = {(hasDataSource ? "true" : "false")},"); writer.AppendLine($"RepeatCount = {repeatCount},"); writer.AppendLine($"DependsOn = {dependsOnArray},"); - writer.AppendLine("Materializer = GetTestsAsync"); + writer.AppendLine("Materializer = GetTests"); writer.Unindent(); writer.AppendLine("};"); @@ -3545,7 +3552,7 @@ private static void GenerateGenericTestWithConcreteTypes( writer.AppendLine("};"); writer.AppendLine("genericMetadata.TestSessionId = testSessionId;"); - writer.AppendLine("yield return genericMetadata;"); + writer.AppendLine("__results.Add(genericMetadata);"); } private static List ExtractTypeArgumentSets(IEnumerable attributes) @@ -5162,7 +5169,7 @@ private static void GenerateConcreteTestMetadataForNonGeneric( writer.Unindent(); writer.AppendLine("};"); - writer.AppendLine("yield return metadata;"); + writer.AppendLine("__results.Add(metadata);"); } private static int? ExtractRepeatCount(IMethodSymbol methodSymbol, INamedTypeSymbol typeSymbol) diff --git a/TUnit.Core/Interfaces/SourceGenerator/ITestSource.cs b/TUnit.Core/Interfaces/SourceGenerator/ITestSource.cs index 0c9f673c4a..25f7ece7a0 100644 --- a/TUnit.Core/Interfaces/SourceGenerator/ITestSource.cs +++ b/TUnit.Core/Interfaces/SourceGenerator/ITestSource.cs @@ -10,11 +10,11 @@ /// /// /// Fast enumeration via -/// Lazy materialization via +/// Lazy materialization via /// /// /// If is not implemented, the discovery pipeline -/// falls back to for all tests. +/// falls back to for all tests. /// /// public interface ITestSource @@ -23,7 +23,6 @@ public interface ITestSource /// Gets all test metadata for this test source. /// /// The test session identifier. - /// Cancellation token. - /// An async enumerable of test metadata. - IAsyncEnumerable GetTestsAsync(string testSessionId, CancellationToken cancellationToken = default); + /// A read-only list of test metadata. + IReadOnlyList GetTests(string testSessionId); } diff --git a/TUnit.Core/TestDescriptor.cs b/TUnit.Core/TestDescriptor.cs index e01a1b4e83..900c4e41a3 100644 --- a/TUnit.Core/TestDescriptor.cs +++ b/TUnit.Core/TestDescriptor.cs @@ -88,11 +88,11 @@ public readonly struct TestDescriptor /// Only invoked for tests that pass filtering. /// /// - /// The delegate accepts a test session ID and cancellation token, returning an async enumerable - /// of TestMetadata. For non-parameterized tests, this yields a single item. - /// For parameterized tests, this yields one item per data row. + /// The delegate accepts a test session ID and returns a list of TestMetadata. + /// For non-parameterized tests, this returns a single-element list. + /// For parameterized tests, this returns one element per data row. /// - public required Func> Materializer { get; init; } + public required Func> Materializer { get; init; } /// /// Initializes a new instance of the struct. diff --git a/TUnit.Engine/Building/Collectors/AotTestDataCollector.cs b/TUnit.Engine/Building/Collectors/AotTestDataCollector.cs index 4e365485af..cff2bdb3b3 100644 --- a/TUnit.Engine/Building/Collectors/AotTestDataCollector.cs +++ b/TUnit.Engine/Building/Collectors/AotTestDataCollector.cs @@ -52,10 +52,10 @@ public async Task> CollectTestsAsync(string testSessio { // Single-pass two-phase discovery: enumerate all descriptors once, // apply type and descriptor filters during enumeration, expand dependencies from index - standardTestMetadatas = await CollectTestsWithTwoPhaseDiscoveryAsync( + standardTestMetadatas = CollectTestsWithTwoPhaseDiscovery( Sources.TestSources, testSessionId, - filterHints).ConfigureAwait(false); + filterHints); } else { @@ -69,7 +69,7 @@ public async Task> CollectTestsAsync(string testSessio } var testSourcesList = testSourcesByType.SelectMany(kvp => kvp.Value).ToList(); - standardTestMetadatas = await CollectTestsTraditionalAsync(testSourcesList, testSessionId).ConfigureAwait(false); + standardTestMetadatas = CollectTestsTraditional(testSourcesList, testSessionId); } // Dynamic tests are typically rare, collect sequentially @@ -92,7 +92,7 @@ public async Task> CollectTestsAsync(string testSessio /// enumerated descriptors to find dependencies, and then this method enumerated /// them again for filtering and materialization. /// - private async Task> CollectTestsWithTwoPhaseDiscoveryAsync( + private IEnumerable CollectTestsWithTwoPhaseDiscovery( IEnumerable>> allSourcesByType, string testSessionId, FilterHints filterHints) @@ -209,9 +209,10 @@ private async Task> CollectTestsWithTwoPhaseDiscoveryA foreach (var descriptor in descriptorsToMaterialize) { - await foreach (var metadata in descriptor.Materializer(testSessionId, CancellationToken.None).ConfigureAwait(false)) + var materialized = descriptor.Materializer(testSessionId); + for (var i = 0; i < materialized.Count; i++) { - results.Add(metadata); + results.Add(materialized[i]); } } @@ -222,29 +223,20 @@ private async Task> CollectTestsWithTwoPhaseDiscoveryA /// Traditional collection: materialize all tests from sources. /// Used when filter hints are not available or sources don't support ITestDescriptorSource. /// - private async Task> CollectTestsTraditionalAsync( + private IEnumerable CollectTestsTraditional( List testSourcesList, string testSessionId) { - // Use sequential processing for small test source sets to avoid task scheduling overhead - if (testSourcesList.Count < Building.ParallelThresholds.MinItemsForParallel) + var results = new List(); + foreach (var testSource in testSourcesList) { - var results = new List(); - foreach (var testSource in testSourcesList) + var tests = testSource.GetTests(testSessionId); + for (var i = 0; i < tests.Count; i++) { - await foreach (var metadata in testSource.GetTestsAsync(testSessionId)) - { - results.Add(metadata); - } + results.Add(tests[i]); } - return results; - } - else - { - return await testSourcesList - .SelectManyAsync(testSource => testSource.GetTestsAsync(testSessionId)) - .ProcessInParallel(); } + return results; } [RequiresUnreferencedCode("Dynamic test collection requires expression compilation and reflection")] @@ -568,19 +560,16 @@ public IEnumerable EnumerateDescriptors() /// Materializes full test metadata from filtered descriptors. /// Only called for tests that passed filtering, avoiding unnecessary materialization. /// - public async IAsyncEnumerable MaterializeFromDescriptorsAsync( + public IEnumerable MaterializeFromDescriptors( IEnumerable descriptors, - string testSessionId, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + string testSessionId) { foreach (var descriptor in descriptors) { - cancellationToken.ThrowIfCancellationRequested(); - - // Use the materializer delegate to create full TestMetadata - await foreach (var metadata in descriptor.Materializer(testSessionId, cancellationToken).ConfigureAwait(false)) + var materialized = descriptor.Materializer(testSessionId); + for (var i = 0; i < materialized.Count; i++) { - yield return metadata; + yield return materialized[i]; } } } diff --git a/TUnit.Engine/Building/Interfaces/ITestDataCollector.cs b/TUnit.Engine/Building/Interfaces/ITestDataCollector.cs index 87a856303b..609b20e2ca 100644 --- a/TUnit.Engine/Building/Interfaces/ITestDataCollector.cs +++ b/TUnit.Engine/Building/Interfaces/ITestDataCollector.cs @@ -37,10 +37,8 @@ internal interface ITestDataCollector /// /// Descriptors that passed filtering. /// The test session identifier. - /// Cancellation token. /// Collection of fully materialized test metadata. - IAsyncEnumerable MaterializeFromDescriptorsAsync( + IEnumerable MaterializeFromDescriptors( IEnumerable descriptors, - string testSessionId, - CancellationToken cancellationToken = default); + string testSessionId); } diff --git a/TUnit.Engine/Building/TestBuilderPipeline.cs b/TUnit.Engine/Building/TestBuilderPipeline.cs index 879384ed8d..9cd01fd205 100644 --- a/TUnit.Engine/Building/TestBuilderPipeline.cs +++ b/TUnit.Engine/Building/TestBuilderPipeline.cs @@ -130,15 +130,6 @@ public async Task> BuildTestsStreamingAsync( .ProcessInParallel(cancellationToken: cancellationToken); } - private async IAsyncEnumerable ToAsyncEnumerable(IEnumerable metadata) - { - await Task.Yield(); // Yield control once at the start to maintain async context - foreach (var item in metadata) - { - yield return item; - } - } - /// /// Builds tests from pre-collected metadata. /// Use this when metadata has already been collected with filter-aware optimization. diff --git a/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs b/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs index 57ec9605e5..c1281a6fc6 100644 --- a/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs +++ b/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs @@ -420,7 +420,7 @@ private static async Task> DiscoverTestsInAssembly(Assembly a try { - var metadata = await BuildTestMetadata(type, resolvedMethod).ConfigureAwait(false); + var metadata = BuildTestMetadata(type, resolvedMethod); discoveredTests.Add(metadata); } catch (Exception ex) @@ -562,7 +562,7 @@ private static async IAsyncEnumerable DiscoverTestsInAssemblyStrea try { - testMetadata = await BuildTestMetadata(type, resolvedMethod).ConfigureAwait(false); + testMetadata = BuildTestMetadata(type, resolvedMethod); } catch (Exception ex) { @@ -639,7 +639,7 @@ private static async Task> DiscoverGenericTests(Type genericT // Build test metadata for the concrete type // No class data for GenerateGenericTest - it just provides type arguments - var testMetadata = await BuildTestMetadata(concreteType, resolvedMethod, null).ConfigureAwait(false); + var testMetadata = BuildTestMetadata(concreteType, resolvedMethod, null); discoveredTests.Add(testMetadata); } } @@ -709,7 +709,7 @@ private static async Task> DiscoverGenericTests(Type genericT // The concrete type already has its generic arguments resolved // For generic types with primary constructors that were resolved from class-level data sources, // we need to ensure the class data sources contain the specific data for this instantiation - var testMetadata = await BuildTestMetadata(concreteType, resolvedMethod, dataRow).ConfigureAwait(false); + var testMetadata = BuildTestMetadata(concreteType, resolvedMethod, dataRow); discoveredTests.Add(testMetadata); } @@ -793,7 +793,7 @@ private static async IAsyncEnumerable DiscoverGenericTestsStreamin // Build test metadata for the concrete type // No class data for GenerateGenericTest - it just provides type arguments - var testMetadata = await BuildTestMetadata(concreteType, resolvedMethod, null).ConfigureAwait(false); + var testMetadata = BuildTestMetadata(concreteType, resolvedMethod, null); successfulTests ??= []; successfulTests.Add(testMetadata); @@ -899,7 +899,7 @@ private static async IAsyncEnumerable DiscoverGenericTestsStreamin // The concrete type already has its generic arguments resolved // For generic types with primary constructors that were resolved from class-level data sources, // we need to ensure the class data sources contain the specific data for this instantiation - var testMetadata = await BuildTestMetadata(concreteType, resolvedMethod, dataRow).ConfigureAwait(false); + var testMetadata = BuildTestMetadata(concreteType, resolvedMethod, dataRow); successfulTests ??= []; successfulTests.Add(testMetadata); @@ -1008,7 +1008,7 @@ private static int CalculateInheritanceDepth(Type testClass, MethodInfo testMeth return depth; } - private static Task BuildTestMetadata( + private static TestMetadata BuildTestMetadata( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type testClass, MethodInfo testMethod, @@ -1041,7 +1041,7 @@ private static Task BuildTestMetadata( try { - return Task.FromResult(new ReflectionTestMetadata(testClass, testMethod) + return new ReflectionTestMetadata(testClass, testMethod) { TestName = testName, TestClassType = typeForGenericResolution, // Use resolved type for generic resolution (may be constructed generic base) @@ -1066,11 +1066,11 @@ private static Task BuildTestMetadata( ?? testClass.Assembly.GetCustomAttribute()?.Times, PropertyInjections = PropertySourceRegistry.DiscoverInjectableProperties(testClass), InheritanceDepth = inheritanceDepth - }); + }; } catch (Exception ex) { - return Task.FromResult(CreateFailedTestMetadata(testClass, testMethod, ex)); + return CreateFailedTestMetadata(testClass, testMethod, ex); } } @@ -2519,51 +2519,46 @@ public IEnumerable EnumerateDescriptors() } } - private static Func> CreateReflectionMaterializer( + private static Func> CreateReflectionMaterializer( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type type, MethodInfo method) { - return (testSessionId, cancellationToken) => MaterializeSingleTestAsync(type, method, cancellationToken); + return testSessionId => MaterializeSingleTest(type, method); } - private static async IAsyncEnumerable MaterializeSingleTestAsync( + private static TestMetadata[] MaterializeSingleTest( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type type, - MethodInfo method, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + MethodInfo method) { - cancellationToken.ThrowIfCancellationRequested(); - TestMetadata metadata; try { - metadata = await BuildTestMetadata(type, method).ConfigureAwait(false); + metadata = BuildTestMetadata(type, method); } catch (Exception ex) { metadata = CreateFailedTestMetadata(type, method, ex); } - yield return metadata; + return [metadata]; } /// /// Materializes full test metadata from filtered descriptors. /// Only called for tests that passed filtering. /// - public async IAsyncEnumerable MaterializeFromDescriptorsAsync( + public IEnumerable MaterializeFromDescriptors( IEnumerable descriptors, - string testSessionId, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + string testSessionId) { foreach (var descriptor in descriptors) { - cancellationToken.ThrowIfCancellationRequested(); - - await foreach (var metadata in descriptor.Materializer(testSessionId, cancellationToken).ConfigureAwait(false)) + var materialized = descriptor.Materializer(testSessionId); + for (var i = 0; i < materialized.Count; i++) { - yield return metadata; + yield return materialized[i]; } } } diff --git a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet10_0.verified.txt b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet10_0.verified.txt index 5c75388a8f..59d676c317 100644 --- a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet10_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet10_0.verified.txt @@ -1438,7 +1438,7 @@ namespace public required string FullyQualifiedName { get; init; } public bool HasDataSource { get; init; } public required int LineNumber { get; init; } - public required > Materializer { get; init; } + public required > Materializer { get; init; } public required string MethodName { get; init; } public string[] Properties { get; init; } public int RepeatCount { get; init; } @@ -2610,7 +2610,7 @@ namespace . } public interface ITestSource { - .<.TestMetadata> GetTestsAsync(string testSessionId, .CancellationToken cancellationToken = default); + .<.TestMetadata> GetTests(string testSessionId); } public sealed class PropertyInjectionMetadata { diff --git a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt index a25bd154dc..73325d809b 100644 --- a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt @@ -1438,7 +1438,7 @@ namespace public required string FullyQualifiedName { get; init; } public bool HasDataSource { get; init; } public required int LineNumber { get; init; } - public required > Materializer { get; init; } + public required > Materializer { get; init; } public required string MethodName { get; init; } public string[] Properties { get; init; } public int RepeatCount { get; init; } @@ -2610,7 +2610,7 @@ namespace . } public interface ITestSource { - .<.TestMetadata> GetTestsAsync(string testSessionId, .CancellationToken cancellationToken = default); + .<.TestMetadata> GetTests(string testSessionId); } public sealed class PropertyInjectionMetadata { diff --git a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt index 68b8e6d296..c5e5894acf 100644 --- a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt @@ -1438,7 +1438,7 @@ namespace public required string FullyQualifiedName { get; init; } public bool HasDataSource { get; init; } public required int LineNumber { get; init; } - public required > Materializer { get; init; } + public required > Materializer { get; init; } public required string MethodName { get; init; } public string[] Properties { get; init; } public int RepeatCount { get; init; } @@ -2610,7 +2610,7 @@ namespace . } public interface ITestSource { - .<.TestMetadata> GetTestsAsync(string testSessionId, .CancellationToken cancellationToken = default); + .<.TestMetadata> GetTests(string testSessionId); } public sealed class PropertyInjectionMetadata { diff --git a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.Net4_7.verified.txt b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.Net4_7.verified.txt index 5092f73a19..6edbeeed59 100644 --- a/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.Net4_7.verified.txt +++ b/TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.Net4_7.verified.txt @@ -1392,7 +1392,7 @@ namespace public required string FullyQualifiedName { get; init; } public bool HasDataSource { get; init; } public required int LineNumber { get; init; } - public required > Materializer { get; init; } + public required > Materializer { get; init; } public required string MethodName { get; init; } public string[] Properties { get; init; } public int RepeatCount { get; init; } @@ -2554,7 +2554,7 @@ namespace . } public interface ITestSource { - .<.TestMetadata> GetTestsAsync(string testSessionId, .CancellationToken cancellationToken = default); + .<.TestMetadata> GetTests(string testSessionId); } public sealed class PropertyInjectionMetadata {