From fadb42c6d7538f74003e532f2e24589725267580 Mon Sep 17 00:00:00 2001
From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com>
Date: Sun, 22 Mar 2026 15:19:49 +0000
Subject: [PATCH 1/5] perf: consolidate module initializers into single .cctor
via partial class
Replace per-class and per-method [ModuleInitializer] methods with static
field initializers on a shared partial class (TUnit_TestRegistration).
The C# compiler merges all field initializers into a single static
constructor (.cctor), reducing JIT overhead from O(N) methods to O(1).
For 10k test classes, this reduces JIT'd methods at startup from ~10,000
separate module initializers to 1 static constructor + 1 helper method.
---
.../AbstractTests.Concrete1.verified.txt | 8 +-
.../AbstractTests.Concrete2.verified.txt | 27 ++----
.../AfterAllTests.Test.verified.txt | 11 ++-
.../AfterTests.Test.verified.txt | 11 ++-
.../ArgsAsArrayTests.Test.verified.txt | 11 ++-
...thImplicitConverterTests.Test.verified.txt | 11 ++-
...lyLoaderTests.Test.DotNet10_0.verified.txt | 9 +-
...blyLoaderTests.Test.DotNet8_0.verified.txt | 9 +-
...blyLoaderTests.Test.DotNet9_0.verified.txt | 9 +-
...semblyLoaderTests.Test.Net4_7.verified.txt | 9 +-
...hodDataSourceDrivenTests.Test.verified.txt | 11 ++-
.../AttributeTests.Test.verified.txt | 11 ++-
.../BasicTests.Test.DotNet10_0.verified.txt | 9 +-
.../BasicTests.Test.DotNet8_0.verified.txt | 9 +-
.../BasicTests.Test.DotNet9_0.verified.txt | 9 +-
.../BasicTests.Test.Net4_7.verified.txt | 9 +-
.../BeforeAllTests.Test.verified.txt | 11 ++-
.../BeforeTests.Test.verified.txt | 11 ++-
...lableTypeTest.Test.DotNet10_0.verified.txt | 9 +-
...llableTypeTest.Test.DotNet8_0.verified.txt | 9 +-
...llableTypeTest.Test.DotNet9_0.verified.txt | 9 +-
...1NullableTypeTest.Test.Net4_7.verified.txt | 9 +-
...sAndMethodArgumentsTests.Test.verified.txt | 11 ++-
.../ClassConstructorTest.Test.verified.txt | 11 ++-
...assDataSourceDrivenTests.Test.verified.txt | 11 ++-
...ssDataSourceDrivenTests2.Test.verified.txt | 11 ++-
...ceDrivenTestsSharedKeyed.Test.verified.txt | 11 ++-
...pleDataSourceDrivenTests.Test.verified.txt | 11 ++-
.../ConcreteClassTests.Test.verified.txt | 27 ++----
...nflictingNamespace.DotNet10_0.verified.txt | 9 +-
...onflictingNamespace.DotNet8_0.verified.txt | 9 +-
...onflictingNamespace.DotNet9_0.verified.txt | 9 +-
...thConflictingNamespace.Net4_7.verified.txt | 9 +-
...nflictingNamespace.DotNet10_0.verified.txt | 9 +-
...onflictingNamespace.DotNet8_0.verified.txt | 9 +-
...onflictingNamespace.DotNet9_0.verified.txt | 9 +-
...thConflictingNamespace.Net4_7.verified.txt | 9 +-
...nflictingNamespace.DotNet10_0.verified.txt | 9 +-
...onflictingNamespace.DotNet8_0.verified.txt | 9 +-
...onflictingNamespace.DotNet9_0.verified.txt | 9 +-
...thConflictingNamespace.Net4_7.verified.txt | 9 +-
...nflictingNamespace.DotNet10_0.verified.txt | 9 +-
...onflictingNamespace.DotNet8_0.verified.txt | 9 +-
...onflictingNamespace.DotNet9_0.verified.txt | 9 +-
...thConflictingNamespace.Net4_7.verified.txt | 9 +-
...nflictingNamespace.DotNet10_0.verified.txt | 9 +-
...onflictingNamespace.DotNet8_0.verified.txt | 9 +-
...onflictingNamespace.DotNet9_0.verified.txt | 9 +-
...thConflictingNamespace.Net4_7.verified.txt | 9 +-
.../ConstantArgumentsTests.Test.verified.txt | 11 ++-
...ConstantInBaseClassTests.Test.verified.txt | 11 ++-
...InterpolatedStringsTests.Test.verified.txt | 11 ++-
.../CustomDisplayNameTests.Test.verified.txt | 11 ++-
.../DataDrivenTests.Test.verified.txt | 11 ++-
...ithDataSourceMethodTests.Test.verified.txt | 11 ++-
...ataSourceGeneratorTests.Typed.verified.txt | 11 ++-
...aSourceGeneratorTests.Untyped.verified.txt | 11 ++-
.../DecimalArgumentTests.Test.verified.txt | 11 ++-
...nScannerTests.Test.DotNet10_0.verified.txt | 9 +-
...onScannerTests.Test.DotNet8_0.verified.txt | 9 +-
...onScannerTests.Test.DotNet9_0.verified.txt | 9 +-
...ctionScannerTests.Test.Net4_7.verified.txt | 9 +-
...mpilesSuccessfully.DotNet10_0.verified.txt | 10 +++
...ompilesSuccessfully.DotNet8_0.verified.txt | 10 +++
...ompilesSuccessfully.DotNet9_0.verified.txt | 10 +++
...s_CompilesSuccessfully.Net4_7.verified.txt | 10 +++
.../EnumMemberNamesTests.Test.verified.txt | 11 ++-
...bleDataSourceDrivenTests.Test.verified.txt | 11 ++-
...pleDataSourceDrivenTests.Test.verified.txt | 11 ++-
...xpectedArgumentTypeTests.Test.verified.txt | 11 ++-
.../GenericMethodTests.Test.verified.txt | 10 +--
...aSource_Should_Generate_Tests.verified.txt | 82 +++++--------------
...cRegistry_WhenNoGenericsFound.verified.txt | 11 ++-
...Constraints_WithInstantiation.verified.txt | 8 +-
...ass_WithExplicitInstantiation.verified.txt | 8 +-
...hod_WithExplicitInstantiation.verified.txt | 8 +-
...est_MultipleGenericParameters.verified.txt | 8 +-
...Tests.Test_NestedGenericTypes.verified.txt | 8 +-
.../Hooks1589.Test.verified.txt | 11 ++-
.../Hooks1594.Test.verified.txt | 11 ++-
...ritedPropertySetterTests.Test.verified.txt | 19 ++---
...romDifferentProjectTests.Test.verified.txt | 25 ++----
...heritsTestsAbstractTests.Test.verified.txt | 27 ++----
.../InheritsTestsTests.Test.verified.txt | 35 +++-----
.../Issue2887Tests.Test.verified.txt | 11 ++-
.../MatrixTests.Test.verified.txt | 11 ++-
...hodDataSourceDrivenTests.Test.verified.txt | 11 ++-
...thCancellationTokenTests.Test.verified.txt | 11 ++-
...assDataSourceDrivenTests.Test.verified.txt | 11 ++-
.../NameOfArgumentTests.Test.verified.txt | 11 ++-
...ullableByteArgumentTests.Test.verified.txt | 11 ++-
.../NumberArgumentTests.Test.verified.txt | 11 ++-
.../NumberArgumentTests.TestDE.verified.txt | 11 ++-
.../PriorityFilteringTests.Test.verified.txt | 11 ++-
.../PropertySetterTests.Test.verified.txt | 11 ++-
...atTests.Assembly_Level_Repeat.verified.txt | 11 ++-
.../RepeatTests.Test.verified.txt | 11 ++-
...TAThreadTests.Test.DotNet10_0.verified.txt | 9 +-
...STAThreadTests.Test.DotNet8_0.verified.txt | 9 +-
...STAThreadTests.Test.DotNet9_0.verified.txt | 9 +-
.../STAThreadTests.Test.Net4_7.verified.txt | 9 +-
.../StringArgumentTests.Test.verified.txt | 11 ++-
.../Tests.Test.verified.txt | 11 ++-
.../Tests1538.Test.verified.txt | 11 ++-
.../Tests1539.Test.verified.txt | 11 ++-
.../Tests1589.Test.verified.txt | 11 ++-
.../Tests1594.Test.verified.txt | 11 ++-
.../Tests1603.Test.verified.txt | 11 ++-
.../Tests1692.Test.verified.txt | 11 ++-
.../Tests1821.Test.verified.txt | 11 ++-
.../Tests1889.Test.DotNet10_0.verified.txt | 24 ++----
.../Tests1889.Test.DotNet8_0.verified.txt | 24 ++----
.../Tests1889.Test.DotNet9_0.verified.txt | 24 ++----
.../Tests1889.Test.Net4_7.verified.txt | 24 ++----
.../Tests1899.Test.verified.txt | 8 +-
.../Tests2083.Test.verified.txt | 11 ++-
.../Tests2085.Test.verified.txt | 11 ++-
.../Tests2112.Test.verified.txt | 11 ++-
.../Tests2136.Test.verified.txt | 10 +--
.../Tests5118.Test.verified.txt | 9 +-
...utCancellationTokenTests.Test.verified.txt | 29 +++----
...pleDataSourceDrivenTests.Test.verified.txt | 11 ++-
...st_AotSafeDataSourceFactories.verified.txt | 11 ++-
...sts.Test_ConfigurationSupport.verified.txt | 11 ++-
..._ModuleInitializer_Generation.verified.txt | 11 ++-
...nglyTypedDelegates_Generation.verified.txt | 11 ++-
.../CodeGenerators/InfrastructureGenerator.cs | 27 ++++++
.../Generators/TestMetadataGenerator.cs | 34 ++++----
TUnit.Core/SourceRegistrar.cs | 21 +++++
...Has_No_API_Changes.DotNet10_0.verified.txt | 2 +
..._Has_No_API_Changes.DotNet8_0.verified.txt | 2 +
..._Has_No_API_Changes.DotNet9_0.verified.txt | 2 +
...ary_Has_No_API_Changes.Net4_7.verified.txt | 2 +
133 files changed, 707 insertions(+), 895 deletions(-)
diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
index e38f2bfafa..a233745939 100644
--- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt
@@ -92,11 +92,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
index a334906dc0..9d37c10762 100644
--- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -94,11 +94,10 @@ internal static class TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource
{
return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
}
@@ -199,13 +198,9 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
}
@@ -305,11 +300,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
index 0c29a6fdad..fe4159b8ea 100644
--- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -145,9 +145,8 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
{
return new global::TUnit.TestProject.AfterTests.CleanupTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
index 0c29a6fdad..fe4159b8ea 100644
--- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -145,9 +145,8 @@ internal static class TUnit_TestProject_AfterTests_CleanupTests__TestSource
{
return new global::TUnit.TestProject.AfterTests.CleanupTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AfterTests_CleanupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), TUnit_TestProject_AfterTests_CleanupTests__TestSource.GetTests, TUnit_TestProject_AfterTests_CleanupTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
index 1e70639135..0076876248 100644
--- a/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -360,9 +360,8 @@ internal static class TUnit_TestProject_ArgsAsArrayTests__TestSource
{
return new global::TUnit.TestProject.ArgsAsArrayTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ArgsAsArrayTests), TUnit_TestProject_ArgsAsArrayTests__TestSource.GetTests, TUnit_TestProject_ArgsAsArrayTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ArgsAsArrayTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ArgsAsArrayTests), TUnit_TestProject_ArgsAsArrayTests__TestSource.GetTests, TUnit_TestProject_ArgsAsArrayTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
index 8d9f875508..8591dcea4a 100644
--- a/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_ArgumentWithImplicitConverterTests__Test
{
return new global::TUnit.TestProject.ArgumentWithImplicitConverterTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests), TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource.GetTests, TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ArgumentWithImplicitConverterTests), TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource.GetTests, TUnit_TestProject_ArgumentWithImplicitConverterTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet10_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet8_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.DotNet9_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 3df345393b..a791373b8c 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyLoaderTests.Test.Net4_7.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt
index aa3814ec29..4a45c27feb 100644
--- a/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AsyncMethodDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -866,9 +866,8 @@ internal static class TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSo
{
return new global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests), TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AsyncMethodDataSourceDrivenTests), TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_AsyncMethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt
index ed535c45e1..2f923e958c 100644
--- a/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AttributeTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -104,9 +104,8 @@ internal static class TUnit_TestProject_AttributeTests__TestSource
{
return new global::TUnit.TestProject.AttributeTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AttributeTests), TUnit_TestProject_AttributeTests__TestSource.GetTests, TUnit_TestProject_AttributeTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AttributeTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AttributeTests), TUnit_TestProject_AttributeTests__TestSource.GetTests, TUnit_TestProject_AttributeTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet10_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet8_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 3df345393b..a791373b8c 100644
--- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.Net4_7.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt
index b0a9db569f..cd08cb2abf 100644
--- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -145,9 +145,8 @@ internal static class TUnit_TestProject_BeforeTests_SetupTests__TestSource
{
return new global::TUnit.TestProject.BeforeTests.SetupTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), TUnit_TestProject_BeforeTests_SetupTests__TestSource.GetTests, TUnit_TestProject_BeforeTests_SetupTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BeforeTests_SetupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), TUnit_TestProject_BeforeTests_SetupTests__TestSource.GetTests, TUnit_TestProject_BeforeTests_SetupTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt
index b0a9db569f..cd08cb2abf 100644
--- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -145,9 +145,8 @@ internal static class TUnit_TestProject_BeforeTests_SetupTests__TestSource
{
return new global::TUnit.TestProject.BeforeTests.SetupTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), TUnit_TestProject_BeforeTests_SetupTests__TestSource.GetTests, TUnit_TestProject_BeforeTests_SetupTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BeforeTests_SetupTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), TUnit_TestProject_BeforeTests_SetupTests__TestSource.GetTests, TUnit_TestProject_BeforeTests_SetupTests__TestSource.EnumerateTestDescriptors);
}
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 22ba64d78e..33bd089a01 100644
--- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet10_0.verified.txt
@@ -93,9 +93,8 @@ internal static class TUnit_TestProject_Bugs__2971_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2971.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2971_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
}
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 22ba64d78e..33bd089a01 100644
--- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet8_0.verified.txt
@@ -93,9 +93,8 @@ internal static class TUnit_TestProject_Bugs__2971_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2971.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2971_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
}
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 22ba64d78e..33bd089a01 100644
--- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.DotNet9_0.verified.txt
@@ -93,9 +93,8 @@ internal static class TUnit_TestProject_Bugs__2971_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2971.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2971_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
}
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 a1b8861398..ade39c0db1 100644
--- a/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Bugs2971NullableTypeTest.Test.Net4_7.verified.txt
@@ -93,9 +93,8 @@ internal static class TUnit_TestProject_Bugs__2971_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2971.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2971_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2971.Tests), TUnit_TestProject_Bugs__2971_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2971_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt
index ff072aec45..915f45d724 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -291,9 +291,8 @@ internal static class TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource
{
return new global::TUnit.TestProject.ClassAndMethodArgumentsTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource.GetTests, TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource.GetTests, TUnit_TestProject_ClassAndMethodArgumentsTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt
index c0e8ff4f77..0f027d8923 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -126,9 +126,8 @@ internal static class TUnit_TestProject_ClassConstructorTest__TestSource
// 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");
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassConstructorTest), TUnit_TestProject_ClassConstructorTest__TestSource.GetTests, TUnit_TestProject_ClassConstructorTest__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassConstructorTest__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassConstructorTest), TUnit_TestProject_ClassConstructorTest__TestSource.GetTests, TUnit_TestProject_ClassConstructorTest__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt
index afbb804bb5..a9a6eb7e43 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -592,9 +592,8 @@ internal static class TUnit_TestProject_ClassDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.ClassDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), TUnit_TestProject_ClassDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), TUnit_TestProject_ClassDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt
index 557dccebfa..52d98dfbfc 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -179,9 +179,8 @@ internal static class TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource
{
return new global::TUnit.TestProject.ClassDataSourceDrivenTests2(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTests2__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt
index a29ac26902..fb4233e256 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -196,9 +196,8 @@ internal static class TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__T
{
return new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__TestSource.GetTests, TUnit_TestProject_ClassDataSourceDrivenTestsSharedKeyed__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt
index 96502b81eb..b37b1a5fe7 100644
--- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -615,9 +615,8 @@ internal static class TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSou
Property4 = default(global::System.ValueTuple),
};
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_ClassTupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt
index a334906dc0..9d37c10762 100644
--- a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -94,11 +94,10 @@ internal static class TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource
{
return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
}
@@ -199,13 +198,9 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
}
@@ -305,11 +300,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
}
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 886335f4bc..541c2796f2 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
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 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
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 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
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 3df345393b..a791373b8c 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
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 7849d6c864..7e2f85dd6a 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
@@ -826,9 +826,8 @@ internal static class TUnit_TestProject_DataDrivenTests__TestSource
{
return new global::TUnit.TestProject.DataDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 7849d6c864..7e2f85dd6a 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
@@ -826,9 +826,8 @@ internal static class TUnit_TestProject_DataDrivenTests__TestSource
{
return new global::TUnit.TestProject.DataDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 7849d6c864..7e2f85dd6a 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
@@ -826,9 +826,8 @@ internal static class TUnit_TestProject_DataDrivenTests__TestSource
{
return new global::TUnit.TestProject.DataDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 91ebc6d8b6..7aa0e643fa 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
@@ -826,9 +826,8 @@ internal static class TUnit_TestProject_DataDrivenTests__TestSource
{
return new global::TUnit.TestProject.DataDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 65d70320f0..1de4364acd 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
@@ -1063,9 +1063,8 @@ internal static class TUnit_TestProject_MatrixTests__TestSource
{
return new global::TUnit.TestProject.MatrixTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MatrixTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
}
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 65d70320f0..1de4364acd 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
@@ -1063,9 +1063,8 @@ internal static class TUnit_TestProject_MatrixTests__TestSource
{
return new global::TUnit.TestProject.MatrixTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MatrixTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
}
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 65d70320f0..1de4364acd 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
@@ -1063,9 +1063,8 @@ internal static class TUnit_TestProject_MatrixTests__TestSource
{
return new global::TUnit.TestProject.MatrixTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MatrixTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
}
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 3c45a99de6..096fc6dc08 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
@@ -1063,9 +1063,8 @@ internal static class TUnit_TestProject_MatrixTests__TestSource
{
return new global::TUnit.TestProject.MatrixTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MatrixTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
}
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 63ab513bbd..f03011c053 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
@@ -864,9 +864,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.MethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 63ab513bbd..f03011c053 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
@@ -864,9 +864,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.MethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 63ab513bbd..f03011c053 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
@@ -864,9 +864,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.MethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 db451c9fb2..8b2cf6fbd0 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
@@ -864,9 +864,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.MethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 64e7c3e83d..046b1445d0 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
@@ -141,9 +141,8 @@ internal static class TUnit_TestProject_TupleDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.TupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 64e7c3e83d..046b1445d0 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
@@ -141,9 +141,8 @@ internal static class TUnit_TestProject_TupleDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.TupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 64e7c3e83d..046b1445d0 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
@@ -141,9 +141,8 @@ internal static class TUnit_TestProject_TupleDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.TupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
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 30f03aea00..86a905b6ea 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
@@ -141,9 +141,8 @@ internal static class TUnit_TestProject_TupleDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.TupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt
index c79fae8609..4ca0b62d6b 100644
--- a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -570,9 +570,8 @@ internal static class TUnit_TestProject_ConstantArgumentsTests__TestSource
{
return new global::TUnit.TestProject.ConstantArgumentsTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ConstantArgumentsTests), TUnit_TestProject_ConstantArgumentsTests__TestSource.GetTests, TUnit_TestProject_ConstantArgumentsTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ConstantArgumentsTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ConstantArgumentsTests), TUnit_TestProject_ConstantArgumentsTests__TestSource.GetTests, TUnit_TestProject_ConstantArgumentsTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt
index f30010e5a0..d1e2ebbc5e 100644
--- a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -114,9 +114,8 @@ internal static class TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__Tes
{
return new global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_ConstantInBaseClassTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt
index c47355ba28..2758d117e7 100644
--- a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -114,9 +114,8 @@ internal static class TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedString
{
return new global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_ConstantsInInterpolatedStringsTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt
index 0e36364ba1..a4af657101 100644
--- a/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -830,9 +830,8 @@ internal static class TUnit_TestProject_CustomDisplayNameTests__TestSource
{
return new global::TUnit.TestProject.CustomDisplayNameTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.CustomDisplayNameTests), TUnit_TestProject_CustomDisplayNameTests__TestSource.GetTests, TUnit_TestProject_CustomDisplayNameTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_CustomDisplayNameTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.CustomDisplayNameTests), TUnit_TestProject_CustomDisplayNameTests__TestSource.GetTests, TUnit_TestProject_CustomDisplayNameTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt
index 91ebc6d8b6..7e2f85dd6a 100644
--- a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -826,9 +826,8 @@ internal static class TUnit_TestProject_DataDrivenTests__TestSource
{
return new global::TUnit.TestProject.DataDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataDrivenTests), TUnit_TestProject_DataDrivenTests__TestSource.GetTests, TUnit_TestProject_DataDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt
index 066dc300a1..33bcf59f68 100644
--- a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -272,9 +272,8 @@ internal static class TUnit_TestProject_DataSourceClassCombinedWithDataSourceMet
{
return new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod__TestSource.GetTests, TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod__TestSource.GetTests, TUnit_TestProject_DataSourceClassCombinedWithDataSourceMethod__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt
index d876a36b36..f0f22ca78a 100644
--- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Typed.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -329,9 +329,8 @@ internal static class TUnit_TestProject_DataSourceGeneratorTests__TestSource
{
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]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), TUnit_TestProject_DataSourceGeneratorTests__TestSource.GetTests, TUnit_TestProject_DataSourceGeneratorTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DataSourceGeneratorTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), TUnit_TestProject_DataSourceGeneratorTests__TestSource.GetTests, TUnit_TestProject_DataSourceGeneratorTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt
index 27528b74d6..0be38f81c6 100644
--- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Untyped.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -119,9 +119,8 @@ internal static class TUnit_TestProject_AutoDataTests__TestSource
{
return new global::TUnit.TestProject.AutoDataTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AutoDataTests), TUnit_TestProject_AutoDataTests__TestSource.GetTests, TUnit_TestProject_AutoDataTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AutoDataTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AutoDataTests), TUnit_TestProject_AutoDataTests__TestSource.GetTests, TUnit_TestProject_AutoDataTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt
index c9b631d910..fd0c661749 100644
--- a/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DecimalArgumentTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -980,9 +980,8 @@ internal static class TUnit_TestProject_DecimalArgumentTests__TestSource
{
return new global::TUnit.TestProject.DecimalArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.DecimalArgumentTests), TUnit_TestProject_DecimalArgumentTests__TestSource.GetTests, TUnit_TestProject_DecimalArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_DecimalArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.DecimalArgumentTests), TUnit_TestProject_DecimalArgumentTests__TestSource.GetTests, TUnit_TestProject_DecimalArgumentTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet10_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 886335f4bc..541c2796f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
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 3df345393b..a791373b8c 100644
--- a/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt
@@ -200,9 +200,8 @@ internal static class TUnit_TestProject_BasicTests__TestSource
{
return new global::TUnit.TestProject.BasicTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_BasicTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.BasicTests), TUnit_TestProject_BasicTests__TestSource.GetTests, TUnit_TestProject_BasicTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet10_0.verified.txt
index 5b0de5e9e2..eda5a27636 100644
--- a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet10_0.verified.txt
@@ -100,9 +100,19 @@ file static class TUnitInfrastructure
catch { /* TUnit.Core not available - skip logging */ }
}
try
+ {
+ global::System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(global::TUnit.Generated.TUnit_TestRegistration).TypeHandle);
+ }
+ catch (global::System.TypeLoadException) { /* Type not emitted - no test registrations */ }
+ try
{
global::TUnit.Core.GlobalContext.Current.GlobalLogger.LogDebug("[ModuleInitializer:TestsBase`1] TUnit infrastructure initialized");
}
catch { /* TUnit.Core not available - skip logging */ }
}
}
+namespace TUnit.Generated
+{
+ [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
+ internal static partial class TUnit_TestRegistration { }
+}
diff --git a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet8_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet8_0.verified.txt
index 5b0de5e9e2..eda5a27636 100644
--- a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet8_0.verified.txt
@@ -100,9 +100,19 @@ file static class TUnitInfrastructure
catch { /* TUnit.Core not available - skip logging */ }
}
try
+ {
+ global::System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(global::TUnit.Generated.TUnit_TestRegistration).TypeHandle);
+ }
+ catch (global::System.TypeLoadException) { /* Type not emitted - no test registrations */ }
+ try
{
global::TUnit.Core.GlobalContext.Current.GlobalLogger.LogDebug("[ModuleInitializer:TestsBase`1] TUnit infrastructure initialized");
}
catch { /* TUnit.Core not available - skip logging */ }
}
}
+namespace TUnit.Generated
+{
+ [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
+ internal static partial class TUnit_TestRegistration { }
+}
diff --git a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet9_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet9_0.verified.txt
index 5b0de5e9e2..eda5a27636 100644
--- a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.DotNet9_0.verified.txt
@@ -100,9 +100,19 @@ file static class TUnitInfrastructure
catch { /* TUnit.Core not available - skip logging */ }
}
try
+ {
+ global::System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(global::TUnit.Generated.TUnit_TestRegistration).TypeHandle);
+ }
+ catch (global::System.TypeLoadException) { /* Type not emitted - no test registrations */ }
+ try
{
global::TUnit.Core.GlobalContext.Current.GlobalLogger.LogDebug("[ModuleInitializer:TestsBase`1] TUnit infrastructure initialized");
}
catch { /* TUnit.Core not available - skip logging */ }
}
}
+namespace TUnit.Generated
+{
+ [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
+ internal static partial class TUnit_TestRegistration { }
+}
diff --git a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.Net4_7.verified.txt b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.Net4_7.verified.txt
index a823905ace..fc43d788c5 100644
--- a/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/DuplicateTypeNameAcrossAssembliesTests.InfrastructureGenerator_WithDuplicateTypeNames_CompilesSuccessfully.Net4_7.verified.txt
@@ -100,9 +100,19 @@ file static class TUnitInfrastructure
catch { /* TUnit.Core not available - skip logging */ }
}
try
+ {
+ global::System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(global::TUnit.Generated.TUnit_TestRegistration).TypeHandle);
+ }
+ catch (global::System.TypeLoadException) { /* Type not emitted - no test registrations */ }
+ try
{
global::TUnit.Core.GlobalContext.Current.GlobalLogger.LogDebug("[ModuleInitializer:TestsBase`1] TUnit infrastructure initialized");
}
catch { /* TUnit.Core not available - skip logging */ }
}
}
+namespace TUnit.Generated
+{
+ [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]
+ internal static partial class TUnit_TestRegistration { }
+}
diff --git a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt
index 6f8d822c25..df78ad1797 100644
--- a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -119,9 +119,8 @@ internal static class TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSou
{
return new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSource.GetTests, TUnit_TestProject_Bugs__1432_EnumMemberNamesTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt
index 78f26c382c..873dc4b5a1 100644
--- a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -393,9 +393,8 @@ internal static class TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSou
{
return new global::TUnit.TestProject.EnumerableDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_EnumerableDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt
index c2772e68c4..d3ce688b1c 100644
--- a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -205,9 +205,8 @@ internal static class TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__Te
{
return new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_EnumerableTupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt
index 3caf7eb277..1ad4fde735 100644
--- a/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ExpectedArgumentTypeTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -234,9 +234,8 @@ internal static class TUnit_TestProject_ExpectedArgumentTypeTests__TestSource
{
return new global::TUnit.TestProject.ExpectedArgumentTypeTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ExpectedArgumentTypeTests), TUnit_TestProject_ExpectedArgumentTypeTests__TestSource.GetTests, TUnit_TestProject_ExpectedArgumentTypeTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ExpectedArgumentTypeTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ExpectedArgumentTypeTests), TUnit_TestProject_ExpectedArgumentTypeTests__TestSource.GetTests, TUnit_TestProject_ExpectedArgumentTypeTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt
index 3fb0dbc31b..3282c7e988 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -321,11 +321,7 @@ internal sealed class TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpect
};
}
}
-internal static class TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpectedOutput__IEnumerable_TSourc_06BD488B_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.GenericMethodTests), new TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpectedOutput__IEnumerable_TSourc_06BD488B_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpectedOutput__IEnumerable_TSourc_06BD488B_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.GenericMethodTests), new TUnit_TestProject_GenericMethodTests_AggregateBy_HasExpectedOutput__IEnumerable_TSourc_06BD488B_TestSource());
}
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 bf1a36e8f0..dadfa9c589 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
@@ -211,13 +211,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Sh
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassNoDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassNoDataSource_T_Should_Create_Instance_TestSource());
}
@@ -495,13 +491,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSou
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithMethodDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassWithMethodDataSource_T_Should_Have_Number__int_TestSource());
}
@@ -782,13 +774,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethod), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethod_GenericMethod_Should_Work_TestSource());
}
@@ -1062,13 +1050,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMet
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMeth_0AB5EDCD_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMeth_0AB5EDCD_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMeth_0AB5EDCD_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.NonGenericClassWithGenericMethodAndDataSource), new TUnit_TestProject_Bugs__4431_NonGenericClassWithGenericMethodAndDataSource_GenericMeth_0AB5EDCD_TestSource());
}
@@ -1423,13 +1407,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), new TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithGenericMethod<>), new TUnit_TestProject_Bugs__4431_GenericClassWithGenericMethod_TClass_BothGeneric_Should_Work_TestSource());
}
@@ -1648,13 +1628,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T_Should_Have_Label_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), new TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T_Should_Have_Label_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T_Should_Have_Label_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithConstructor<>), new TUnit_TestProject_Bugs__4431_GenericClassWithConstructor_T_Should_Have_Label_TestSource());
}
@@ -1873,13 +1849,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_Should_Handle_Multiple_Type__8C0B02C5_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.MultipleTypeParameters<,>), new TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_Should_Handle_Multiple_Type__8C0B02C5_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_Should_Handle_Multiple_Type__8C0B02C5_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.MultipleTypeParameters<,>), new TUnit_TestProject_Bugs__4431_MultipleTypeParameters_T1_T2_Should_Handle_Multiple_Type__8C0B02C5_TestSource());
}
@@ -2098,13 +2070,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_Create_From_Base_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.DerivedGenericClass<>), new TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_Create_From_Base_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_Create_From_Base_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.DerivedGenericClass<>), new TUnit_TestProject_Bugs__4431_DerivedGenericClass_T_Should_Create_From_Base_TestSource());
}
@@ -2440,13 +2408,9 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSour
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSource_T_Should_Have_DataSource_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithClassDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSource_T_Should_Have_DataSource_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSource_T_Should_Have_DataSource_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassWithClassDataSource<>), new TUnit_TestProject_Bugs__4431_GenericClassWithClassDataSource_T_Should_Have_DataSource_TestSource());
}
@@ -3111,11 +3075,7 @@ internal sealed class TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWith
};
}
}
-internal static class TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWithDataSources_TClass_FullyGene_0A3B401E_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassGenericMethodWithDataSources<>), new TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWithDataSources_TClass_FullyGene_0A3B401E_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWithDataSources_TClass_FullyGene_0A3B401E_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._4431.GenericClassGenericMethodWithDataSources<>), new TUnit_TestProject_Bugs__4431_GenericClassGenericMethodWithDataSources_TClass_FullyGene_0A3B401E_TestSource());
}
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 c5642cab45..5f63744743 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_EmptyGenericRegistry_WhenNoGenericsFound.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -92,9 +92,8 @@ internal static class TUnit_TestProject_SimpleTestClass__TestSource
{
return new global::TUnit.TestProject.SimpleTestClass();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.SimpleTestClass), TUnit_TestProject_SimpleTestClass__TestSource.GetTests, TUnit_TestProject_SimpleTestClass__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_SimpleTestClass__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.SimpleTestClass), TUnit_TestProject_SimpleTestClass__TestSource.GetTests, TUnit_TestProject_SimpleTestClass__TestSource.EnumerateTestDescriptors);
}
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 21436bf844..ca8388a672 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt
@@ -208,11 +208,7 @@ internal sealed class TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod
};
}
}
-internal static class TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ConstrainedGenericTestClass<>), new TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ConstrainedGenericTestClass<>), new TUnit_TestProject_ConstrainedGenericTestClass_T_TestMethod_TestSource());
}
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 da34c4f1a8..c35465369a 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt
@@ -208,11 +208,7 @@ internal sealed class TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource
};
}
}
-internal static class TUnit_TestProject_GenericTestClass_T_TestMethod_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.GenericTestClass<>), new TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.GenericTestClass<>), new TUnit_TestProject_GenericTestClass_T_TestMethod_TestSource());
}
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 7cb6e27314..a0f3d9fbe4 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt
@@ -204,11 +204,7 @@ internal sealed class TUnit_TestProject_TestClass_GenericTestMethod_TestSource :
};
}
}
-internal static class TUnit_TestProject_TestClass_GenericTestMethod_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TestClass), new TUnit_TestProject_TestClass_GenericTestMethod_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_TestClass_GenericTestMethod_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TestClass), new TUnit_TestProject_TestClass_GenericTestMethod_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt
index bfd48af3ec..278513d57a 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt
@@ -208,11 +208,7 @@ internal sealed class TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_T
};
}
}
-internal static class TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MultiGenericTestClass<,>), new TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MultiGenericTestClass<,>), new TUnit_TestProject_MultiGenericTestClass_T1_T2_TestMethod_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt
index 7bd177afb7..208c388363 100644
--- a/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt
@@ -208,11 +208,7 @@ internal sealed class TUnit_TestProject_NestedGenericTestClass_T_TestMethod_Test
};
}
}
-internal static class TUnit_TestProject_NestedGenericTestClass_T_TestMethod_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.NestedGenericTestClass<>), new TUnit_TestProject_NestedGenericTestClass_T_TestMethod_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_NestedGenericTestClass_T_TestMethod_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.NestedGenericTestClass<>), new TUnit_TestProject_NestedGenericTestClass_T_TestMethod_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt
index 307055a127..aa5d9eaf4e 100644
--- a/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Hooks1589.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -110,9 +110,8 @@ internal static class TUnit_TestProject_Bugs__1589_MyTests__TestSource
{
return new global::TUnit.TestProject.Bugs._1589.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1589.MyTests), TUnit_TestProject_Bugs__1589_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1589_MyTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1589_MyTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1589.MyTests), TUnit_TestProject_Bugs__1589_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1589_MyTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt
index 13e522ea29..60c5e3c5c3 100644
--- a/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Hooks1594.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -111,9 +111,8 @@ internal static class TUnit_TestProject_Bugs__1594_MyTests__TestSource
{
return new global::TUnit.TestProject.Bugs._1594.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1594.MyTests), TUnit_TestProject_Bugs__1594_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1594_MyTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1594_MyTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1594.MyTests), TUnit_TestProject_Bugs__1594_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1594_MyTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt
index df5c85d0c6..917ef801ad 100644
--- a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -600,11 +600,10 @@ internal static class TUnit_TestProject_PropertySetterTests__TestSource
Property7 = default!,
};
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.PropertySetterTests), TUnit_TestProject_PropertySetterTests__TestSource.GetTests, TUnit_TestProject_PropertySetterTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_PropertySetterTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.PropertySetterTests), TUnit_TestProject_PropertySetterTests__TestSource.GetTests, TUnit_TestProject_PropertySetterTests__TestSource.EnumerateTestDescriptors);
}
@@ -868,11 +867,7 @@ internal sealed class TUnit_TestProject_InheritedPropertySetterTests_Test_TestSo
}
}
}
-internal static class TUnit_TestProject_InheritedPropertySetterTests_Test_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), new TUnit_TestProject_InheritedPropertySetterTests_Test_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_InheritedPropertySetterTests_Test_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), new TUnit_TestProject_InheritedPropertySetterTests_Test_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt
index 4e7001a6f2..13eca376f2 100644
--- a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt
@@ -347,11 +347,10 @@ internal static class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_
{
return new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), TUnit_TestProject_InheritedTestsFromDifferentProjectTests__TestSource.GetTests, TUnit_TestProject_InheritedTestsFromDifferentProjectTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_InheritedTestsFromDifferentProjectTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), TUnit_TestProject_InheritedTestsFromDifferentProjectTests__TestSource.GetTests, TUnit_TestProject_InheritedTestsFromDifferentProjectTests__TestSource.EnumerateTestDescriptors);
}
@@ -455,13 +454,9 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_
}
}
}
-internal static class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTest_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), new TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTest_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTest_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), new TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTest_TestSource());
}
@@ -566,11 +561,7 @@ internal sealed class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_
}
}
}
-internal static class TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTestWithMultipleCategories_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), new TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTestWithMultipleCategories_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTestWithMultipleCategories_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), new TUnit_TestProject_InheritedTestsFromDifferentProjectTests_BaseTestWithMultipleCategories_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt
index a334906dc0..9d37c10762 100644
--- a/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/InheritsTestsAbstractTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -94,11 +94,10 @@ internal static class TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource
{
return new global::TUnit.TestProject.AbstractTests.ConcreteClass2();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.GetTests, TUnit_TestProject_AbstractTests_ConcreteClass2__TestSource.EnumerateTestDescriptors);
}
@@ -199,13 +198,9 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), new TUnit_TestProject_AbstractTests_ConcreteClass2_AssertClassName_TestSource());
}
@@ -305,11 +300,7 @@ internal sealed class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClass
}
}
}
-internal static class TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), new TUnit_TestProject_AbstractTests_ConcreteClass1_AssertClassName_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt
index 7ea4a41501..04606efcb9 100644
--- a/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/InheritsTestsTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -210,11 +210,10 @@ internal static class TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource
Data = default!,
};
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1924.None.BaseClass), TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource.GetTests, TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1924.None.BaseClass), TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource.GetTests, TUnit_TestProject_Bugs__1924_None_BaseClass__TestSource.EnumerateTestDescriptors);
}
@@ -366,13 +365,9 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSour
}
}
}
-internal static class TUnit_TestProject_Bugs__1924_None_Tests_Test__int_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests), new TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests), new TUnit_TestProject_Bugs__1924_None_Tests_Test__int_TestSource());
}
@@ -524,13 +519,9 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSou
}
}
}
-internal static class TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests2), new TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests2), new TUnit_TestProject_Bugs__1924_None_Tests2_Test__int_TestSource());
}
@@ -682,11 +673,7 @@ internal sealed class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSou
}
}
}
-internal static class TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests3), new TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1924.None.Tests3), new TUnit_TestProject_Bugs__1924_None_Tests3_Test__int_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt
index 263b89a242..05679e8921 100644
--- a/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Issue2887Tests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -100,9 +100,8 @@ internal static class TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSou
// 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");
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._Issue2887.ActualTestClass), TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSource.GetTests, TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._Issue2887.ActualTestClass), TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSource.GetTests, TUnit_TestProject_Bugs__Issue2887_ActualTestClass__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt
index 45b13c9673..2527b9bcee 100644
--- a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -1063,9 +1063,8 @@ internal static class TUnit_TestProject_MatrixTests__TestSource
{
return new global::TUnit.TestProject.MatrixTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MatrixTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MatrixTests), TUnit_TestProject_MatrixTests__TestSource.GetTests, TUnit_TestProject_MatrixTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt
index db451c9fb2..f03011c053 100644
--- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -864,9 +864,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.MethodDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt
index 77ecf4b336..9dd1c6d72b 100644
--- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -341,9 +341,8 @@ internal static class TUnit_TestProject_MethodDataSourceDrivenWithCancellationTo
{
return new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests__TestSource.GetTests, TUnit_TestProject_MethodDataSourceDrivenWithCancellationTokenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt
index 9b84c0ea9f..ba4a6878df 100644
--- a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -191,9 +191,8 @@ internal static class TUnit_TestProject_MultipleClassDataSourceDrivenTests__Test
{
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]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), TUnit_TestProject_MultipleClassDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MultipleClassDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_MultipleClassDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), TUnit_TestProject_MultipleClassDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_MultipleClassDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt
index d810de3328..48a66789e8 100644
--- a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -114,9 +114,8 @@ internal static class TUnit_TestProject_NameOfArgumentTests__TestSource
{
return new global::TUnit.TestProject.NameOfArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.NameOfArgumentTests), TUnit_TestProject_NameOfArgumentTests__TestSource.GetTests, TUnit_TestProject_NameOfArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_NameOfArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.NameOfArgumentTests), TUnit_TestProject_NameOfArgumentTests__TestSource.GetTests, TUnit_TestProject_NameOfArgumentTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt
index 18b6ec33ac..bb4b7fcf1c 100644
--- a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -198,9 +198,8 @@ internal static class TUnit_TestProject_NullableByteArgumentTests__TestSource
{
return new global::TUnit.TestProject.NullableByteArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.NullableByteArgumentTests), TUnit_TestProject_NullableByteArgumentTests__TestSource.GetTests, TUnit_TestProject_NullableByteArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_NullableByteArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.NullableByteArgumentTests), TUnit_TestProject_NullableByteArgumentTests__TestSource.GetTests, TUnit_TestProject_NullableByteArgumentTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt
index 88d4197465..724bfb39e3 100644
--- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -500,9 +500,8 @@ internal static class TUnit_TestProject_NumberArgumentTests__TestSource
{
return new global::TUnit.TestProject.NumberArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.NumberArgumentTests), TUnit_TestProject_NumberArgumentTests__TestSource.GetTests, TUnit_TestProject_NumberArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_NumberArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.NumberArgumentTests), TUnit_TestProject_NumberArgumentTests__TestSource.GetTests, TUnit_TestProject_NumberArgumentTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt
index 88d4197465..724bfb39e3 100644
--- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -500,9 +500,8 @@ internal static class TUnit_TestProject_NumberArgumentTests__TestSource
{
return new global::TUnit.TestProject.NumberArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.NumberArgumentTests), TUnit_TestProject_NumberArgumentTests__TestSource.GetTests, TUnit_TestProject_NumberArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_NumberArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.NumberArgumentTests), TUnit_TestProject_NumberArgumentTests__TestSource.GetTests, TUnit_TestProject_NumberArgumentTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt
index e2de3c4e76..3aa41ad3f4 100644
--- a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -378,9 +378,8 @@ internal static class TUnit_TestProject_PriorityFilteringTests__TestSource
{
return new global::TUnit.TestProject.PriorityFilteringTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.PriorityFilteringTests), TUnit_TestProject_PriorityFilteringTests__TestSource.GetTests, TUnit_TestProject_PriorityFilteringTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_PriorityFilteringTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.PriorityFilteringTests), TUnit_TestProject_PriorityFilteringTests__TestSource.GetTests, TUnit_TestProject_PriorityFilteringTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt
index 8544e06dcf..4b5c5bb687 100644
--- a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -600,9 +600,8 @@ internal static class TUnit_TestProject_PropertySetterTests__TestSource
Property7 = default!,
};
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.PropertySetterTests), TUnit_TestProject_PropertySetterTests__TestSource.GetTests, TUnit_TestProject_PropertySetterTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_PropertySetterTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.PropertySetterTests), TUnit_TestProject_PropertySetterTests__TestSource.GetTests, TUnit_TestProject_PropertySetterTests__TestSource.EnumerateTestDescriptors);
}
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 a0d951b5d2..808e066ba6 100644
--- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Assembly_Level_Repeat.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -161,9 +161,8 @@ internal static class TUnit_TestProject_AssemblyRepeatTests__TestSource
{
return new global::TUnit.TestProject.AssemblyRepeatTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AssemblyRepeatTests), TUnit_TestProject_AssemblyRepeatTests__TestSource.GetTests, TUnit_TestProject_AssemblyRepeatTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AssemblyRepeatTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AssemblyRepeatTests), TUnit_TestProject_AssemblyRepeatTests__TestSource.GetTests, TUnit_TestProject_AssemblyRepeatTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt
index 2435e89113..b29cab31eb 100644
--- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -230,9 +230,8 @@ internal static class TUnit_TestProject_RepeatTests__TestSource
{
return new global::TUnit.TestProject.RepeatTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.RepeatTests), TUnit_TestProject_RepeatTests__TestSource.GetTests, TUnit_TestProject_RepeatTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_RepeatTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.RepeatTests), TUnit_TestProject_RepeatTests__TestSource.GetTests, TUnit_TestProject_RepeatTests__TestSource.EnumerateTestDescriptors);
}
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 7fe922ea2c..416098f41c 100644
--- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet10_0.verified.txt
@@ -893,9 +893,8 @@ internal static class TUnit_TestProject_STAThreadTests__TestSource
{
return new global::TUnit.TestProject.STAThreadTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_STAThreadTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
}
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 7fe922ea2c..416098f41c 100644
--- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet8_0.verified.txt
@@ -893,9 +893,8 @@ internal static class TUnit_TestProject_STAThreadTests__TestSource
{
return new global::TUnit.TestProject.STAThreadTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_STAThreadTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
}
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 7fe922ea2c..416098f41c 100644
--- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.DotNet9_0.verified.txt
@@ -893,9 +893,8 @@ internal static class TUnit_TestProject_STAThreadTests__TestSource
{
return new global::TUnit.TestProject.STAThreadTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_STAThreadTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
}
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 da8e3cb4a2..caf281e26d 100644
--- a/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/STAThreadTests.Test.Net4_7.verified.txt
@@ -893,9 +893,8 @@ internal static class TUnit_TestProject_STAThreadTests__TestSource
{
return new global::TUnit.TestProject.STAThreadTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_STAThreadTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.STAThreadTests), TUnit_TestProject_STAThreadTests__TestSource.GetTests, TUnit_TestProject_STAThreadTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt
index 2c7769106f..51aeeac2d8 100644
--- a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -228,9 +228,8 @@ internal static class TUnit_TestProject_StringArgumentTests__TestSource
{
return new global::TUnit.TestProject.StringArgumentTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.StringArgumentTests), TUnit_TestProject_StringArgumentTests__TestSource.GetTests, TUnit_TestProject_StringArgumentTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_StringArgumentTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.StringArgumentTests), TUnit_TestProject_StringArgumentTests__TestSource.GetTests, TUnit_TestProject_StringArgumentTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt
index 721c9b101d..ddfa8bbc93 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -287,9 +287,8 @@ internal static class TUnit_TestProject_Bugs__1304_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1304.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1304.Tests), TUnit_TestProject_Bugs__1304_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1304_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1304_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1304.Tests), TUnit_TestProject_Bugs__1304_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1304_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt
index 315d1d75bb..4add4977d4 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1538.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -320,9 +320,8 @@ internal static class TUnit_TestProject_Bugs__1538_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1538.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1538.Tests), TUnit_TestProject_Bugs__1538_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1538_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1538_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1538.Tests), TUnit_TestProject_Bugs__1538_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1538_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt
index 1289b3bc57..d260727669 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1539.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -97,9 +97,8 @@ internal static class TUnit_TestProject_Bugs__1539_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1539.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1539.Tests), TUnit_TestProject_Bugs__1539_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1539_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1539_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1539.Tests), TUnit_TestProject_Bugs__1539_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1539_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt
index 307055a127..aa5d9eaf4e 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1589.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -110,9 +110,8 @@ internal static class TUnit_TestProject_Bugs__1589_MyTests__TestSource
{
return new global::TUnit.TestProject.Bugs._1589.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1589.MyTests), TUnit_TestProject_Bugs__1589_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1589_MyTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1589_MyTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1589.MyTests), TUnit_TestProject_Bugs__1589_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1589_MyTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt
index 13e522ea29..60c5e3c5c3 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1594.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -111,9 +111,8 @@ internal static class TUnit_TestProject_Bugs__1594_MyTests__TestSource
{
return new global::TUnit.TestProject.Bugs._1594.MyTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1594.MyTests), TUnit_TestProject_Bugs__1594_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1594_MyTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1594_MyTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1594.MyTests), TUnit_TestProject_Bugs__1594_MyTests__TestSource.GetTests, TUnit_TestProject_Bugs__1594_MyTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt
index 753073a362..077057d282 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1603.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -190,9 +190,8 @@ internal static class TUnit_TestProject_Bugs__1603_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1603.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1603.Tests), TUnit_TestProject_Bugs__1603_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1603_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1603_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1603.Tests), TUnit_TestProject_Bugs__1603_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1603_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt
index 68215b5ea7..eedbde0bd7 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1692.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -116,9 +116,8 @@ internal static class TUnit_TestProject_Bugs__1692_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1692.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1692.Tests), TUnit_TestProject_Bugs__1692_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1692_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1692_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1692.Tests), TUnit_TestProject_Bugs__1692_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1692_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt
index f482bd30f5..87bb24c8f4 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1821.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -216,9 +216,8 @@ internal static class TUnit_TestProject_Bugs__1821_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._1821.Tests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1821.Tests), TUnit_TestProject_Bugs__1821_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1821_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__1821_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1821.Tests), TUnit_TestProject_Bugs__1821_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__1821_Tests__TestSource.EnumerateTestDescriptors);
}
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 34c3894e50..3a24898825 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet10_0.verified.txt
@@ -94,13 +94,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
}
@@ -216,13 +212,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
}
@@ -339,11 +331,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
}
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 34c3894e50..3a24898825 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet8_0.verified.txt
@@ -94,13 +94,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
}
@@ -216,13 +212,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
}
@@ -339,11 +331,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
}
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 34c3894e50..3a24898825 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.DotNet9_0.verified.txt
@@ -94,13 +94,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
}
@@ -216,13 +212,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
}
@@ -339,11 +331,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
}
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 4ee68076d9..c580fcd70f 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1889.Test.Net4_7.verified.txt
@@ -94,13 +94,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test1_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test1_TestSource());
}
@@ -216,13 +212,9 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test2__bool_TestSource());
}
@@ -339,11 +331,7 @@ internal sealed class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestS
}
}
}
-internal static class TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1889.DerivedTest), new TUnit_TestProject_Bugs__1889_DerivedTest_Test3__bool_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt
index 6324214948..b4f15ea03e 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt
@@ -94,11 +94,7 @@ internal sealed class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource
}
}
}
-internal static class TUnit_TestProject_Bugs__1899_DerivedTest_Test1_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._1899.DerivedTest), new TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._1899.DerivedTest), new TUnit_TestProject_Bugs__1899_DerivedTest_Test1_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt
index 2f059db8e4..d2cf1f8029 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests2083.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -125,9 +125,8 @@ internal static class TUnit_TestProject_Bugs__2083_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2083.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2083.Tests), TUnit_TestProject_Bugs__2083_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2083_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2083_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2083.Tests), TUnit_TestProject_Bugs__2083_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2083_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt
index 02089f015e..97a2f65584 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests2085.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -190,9 +190,8 @@ internal static class TUnit_TestProject_Bugs__2085_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2085.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2085.Tests), TUnit_TestProject_Bugs__2085_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2085_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2085_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2085.Tests), TUnit_TestProject_Bugs__2085_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2085_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt
index a577765cbb..6a6b944d43 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests2112.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -260,9 +260,8 @@ internal static class TUnit_TestProject_Bugs__2112_Tests__TestSource
{
return new global::TUnit.TestProject.Bugs._2112.Tests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2112.Tests), TUnit_TestProject_Bugs__2112_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2112_Tests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__2112_Tests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2112.Tests), TUnit_TestProject_Bugs__2112_Tests__TestSource.GetTests, TUnit_TestProject_Bugs__2112_Tests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests2136.Test.verified.txt
index 9b00ce27e0..fc239a0fe7 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
@@ -425,11 +425,7 @@ internal sealed class TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T
};
}
}
-internal static class TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T_string_ModuleInitializer
+internal static partial class TUnit_TestRegistration
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._2136.Tests), new TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T_string_TestSource());
- }
+ static readonly int _r_TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T_string_TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._2136.Tests), new TUnit_TestProject_Bugs__2136_Tests_GenericArgumentsTest__T_string_TestSource());
}
diff --git a/TUnit.Core.SourceGenerator.Tests/Tests5118.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/Tests5118.Test.verified.txt
index f42d711aac..fe32b0b161 100644
--- a/TUnit.Core.SourceGenerator.Tests/Tests5118.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/Tests5118.Test.verified.txt
@@ -146,9 +146,8 @@ internal static class TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTes
{
return new global::TUnit.TestProject.Bugs._5118.AsyncClassMethodDataSourceTests(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::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.Bugs._5118.AsyncClassMethodDataSourceTests), TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTests__TestSource.GetTests, TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.Bugs._5118.AsyncClassMethodDataSourceTests), TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTests__TestSource.GetTests, TUnit_TestProject_Bugs__5118_AsyncClassMethodDataSourceTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt
index 3b6833c9f2..029097aafd 100644
--- a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -877,11 +877,10 @@ internal static class TUnit_TestProject_TimeoutCancellationTokenTests__TestSourc
{
return new global::TUnit.TestProject.TimeoutCancellationTokenTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), TUnit_TestProject_TimeoutCancellationTokenTests__TestSource.GetTests, TUnit_TestProject_TimeoutCancellationTokenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TimeoutCancellationTokenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), TUnit_TestProject_TimeoutCancellationTokenTests__TestSource.GetTests, TUnit_TestProject_TimeoutCancellationTokenTests__TestSource.EnumerateTestDescriptors);
}
@@ -1046,11 +1045,10 @@ internal static class TUnit_TestProject_TimeoutDoesNotFireTests__TestSource
{
return new global::TUnit.TestProject.TimeoutDoesNotFireTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TimeoutDoesNotFireTests), TUnit_TestProject_TimeoutDoesNotFireTests__TestSource.GetTests, TUnit_TestProject_TimeoutDoesNotFireTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TimeoutDoesNotFireTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TimeoutDoesNotFireTests), TUnit_TestProject_TimeoutDoesNotFireTests__TestSource.GetTests, TUnit_TestProject_TimeoutDoesNotFireTests__TestSource.EnumerateTestDescriptors);
}
@@ -1215,9 +1213,8 @@ internal static class TUnit_TestProject_CancellationTokenTriggeredTests__TestSou
{
return new global::TUnit.TestProject.CancellationTokenTriggeredTests(global::TUnit.Core.Helpers.CastHelper.Cast(args[0]));
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.CancellationTokenTriggeredTests), TUnit_TestProject_CancellationTokenTriggeredTests__TestSource.GetTests, TUnit_TestProject_CancellationTokenTriggeredTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_CancellationTokenTriggeredTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.CancellationTokenTriggeredTests), TUnit_TestProject_CancellationTokenTriggeredTests__TestSource.GetTests, TUnit_TestProject_CancellationTokenTriggeredTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt
index 30f03aea00..046b1445d0 100644
--- a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -141,9 +141,8 @@ internal static class TUnit_TestProject_TupleDataSourceDrivenTests__TestSource
{
return new global::TUnit.TestProject.TupleDataSourceDrivenTests();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TupleDataSourceDrivenTests__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.GetTests, TUnit_TestProject_TupleDataSourceDrivenTests__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt
index 5e1232a450..d5915a94e7 100644
--- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_AotSafeDataSourceFactories.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -120,9 +120,8 @@ internal static class TUnit_TestProject_AotDataSourceTest__TestSource
{
return new global::TUnit.TestProject.AotDataSourceTest();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.AotDataSourceTest), TUnit_TestProject_AotDataSourceTest__TestSource.GetTests, TUnit_TestProject_AotDataSourceTest__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_AotDataSourceTest__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.AotDataSourceTest), TUnit_TestProject_AotDataSourceTest__TestSource.GetTests, TUnit_TestProject_AotDataSourceTest__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt
index 33a20caf6c..c4a558c435 100644
--- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ConfigurationSupport.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -92,9 +92,8 @@ internal static class TUnit_TestProject_ConfigurationTest__TestSource
{
return new global::TUnit.TestProject.ConfigurationTest();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ConfigurationTest), TUnit_TestProject_ConfigurationTest__TestSource.GetTests, TUnit_TestProject_ConfigurationTest__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ConfigurationTest__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ConfigurationTest), TUnit_TestProject_ConfigurationTest__TestSource.GetTests, TUnit_TestProject_ConfigurationTest__TestSource.EnumerateTestDescriptors);
}
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 6104e5c120..e78ca37cd1 100644
--- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_ModuleInitializer_Generation.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -92,9 +92,8 @@ internal static class TUnit_TestProject_ModuleInitializerTest__TestSource
{
return new global::TUnit.TestProject.ModuleInitializerTest();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.ModuleInitializerTest), TUnit_TestProject_ModuleInitializerTest__TestSource.GetTests, TUnit_TestProject_ModuleInitializerTest__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_ModuleInitializerTest__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.ModuleInitializerTest), TUnit_TestProject_ModuleInitializerTest__TestSource.GetTests, TUnit_TestProject_ModuleInitializerTest__TestSource.EnumerateTestDescriptors);
}
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 8c5125e2f7..30413c9c07 100644
--- a/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/UnifiedReflectionFreeTests.Test_StronglyTypedDelegates_Generation.verified.txt
@@ -1,4 +1,4 @@
-//
+//
#pragma warning disable
#nullable enable
@@ -92,9 +92,8 @@ internal static class TUnit_TestProject_TypedDelegateTest__TestSource
{
return new global::TUnit.TestProject.TypedDelegateTest();
}
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- internal static void Initialize()
- {
- global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.TypedDelegateTest), TUnit_TestProject_TypedDelegateTest__TestSource.GetTests, TUnit_TestProject_TypedDelegateTest__TestSource.EnumerateTestDescriptors);
- }
+}
+internal static partial class TUnit_TestRegistration
+{
+ static readonly int _r_TUnit_TestProject_TypedDelegateTest__TestSource = global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof(global::TUnit.TestProject.TypedDelegateTest), TUnit_TestProject_TypedDelegateTest__TestSource.GetTests, TUnit_TestProject_TypedDelegateTest__TestSource.EnumerateTestDescriptors);
}
diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/InfrastructureGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/InfrastructureGenerator.cs
index 1810bb336d..40e44ad704 100644
--- a/TUnit.Core.SourceGenerator/CodeGenerators/InfrastructureGenerator.cs
+++ b/TUnit.Core.SourceGenerator/CodeGenerators/InfrastructureGenerator.cs
@@ -447,6 +447,20 @@ private static void GenerateCode(SourceProductionContext context, AssemblyInfoMo
}
sourceBuilder.AppendLine();
+
+ // Trigger the consolidated test registration .cctor.
+ // All per-class and per-method test sources contribute static field initializers
+ // to the TUnit_TestRegistration partial class. RunClassConstructor forces the single
+ // .cctor to execute, performing all registrations in ONE JIT-compiled method.
+ sourceBuilder.AppendLine("try");
+ sourceBuilder.AppendLine("{");
+ sourceBuilder.Indent();
+ sourceBuilder.AppendLine("global::System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(global::TUnit.Generated.TUnit_TestRegistration).TypeHandle);");
+ sourceBuilder.Unindent();
+ sourceBuilder.AppendLine("}");
+ sourceBuilder.AppendLine("catch (global::System.TypeLoadException) { /* Type not emitted - no test registrations */ }");
+ sourceBuilder.AppendLine();
+
sourceBuilder.AppendLine("try");
sourceBuilder.AppendLine("{");
sourceBuilder.Indent();
@@ -457,6 +471,19 @@ private static void GenerateCode(SourceProductionContext context, AssemblyInfoMo
}
}
+ // Empty partial class shell in TUnit.Generated namespace — per-class and per-method
+ // test source files contribute static field initializers to this class.
+ // The compiler merges all contributions into a single .cctor,
+ // which is triggered by RunClassConstructor above.
+ sourceBuilder.AppendLine();
+ sourceBuilder.AppendLine("namespace TUnit.Generated");
+ sourceBuilder.AppendLine("{");
+ sourceBuilder.Indent();
+ sourceBuilder.AppendLine("[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute]");
+ sourceBuilder.AppendLine("internal static partial class TUnit_TestRegistration { }");
+ sourceBuilder.Unindent();
+ sourceBuilder.AppendLine("}");
+
context.AddSource("TUnitInfrastructure.g.cs", sourceBuilder.ToString());
}
}
diff --git a/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs b/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
index 610b96e47b..298a8c389a 100644
--- a/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
+++ b/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
@@ -450,7 +450,7 @@ private static void GenerateTestMetadata(CodeWriter writer, TestMethodMetadata t
if (!useClassHelper)
{
- GenerateModuleInitializer(writer, testMethod, uniqueClassName);
+ GenerateTestRegistrationField(writer, testMethod, uniqueClassName);
}
}
@@ -2404,19 +2404,23 @@ private static string EscapeString(string value)
.Replace("\t", "\\t");
}
- private static void GenerateModuleInitializer(CodeWriter writer, TestMethodMetadata testMethod, string uniqueClassName)
+ private static void GenerateTestRegistrationField(CodeWriter writer, TestMethodMetadata testMethod, string uniqueClassName)
+ {
+ EmitRegistrationField(writer, uniqueClassName,
+ $"global::TUnit.Core.SourceRegistrar.RegisterReturn({GenerateTypeReference(testMethod.TypeSymbol, testMethod.IsGenericType)}, new {uniqueClassName}());");
+ }
+
+ ///
+ /// Emits a static field on the shared TUnit_TestRegistration partial class.
+ /// All contributions merge into a single .cctor, reducing JIT overhead from O(N) methods to O(1).
+ ///
+ private static void EmitRegistrationField(CodeWriter writer, string fieldName, string registrarCall)
{
writer.AppendLine();
- writer.AppendLine($"internal static class {uniqueClassName.Replace("_TestSource", "_ModuleInitializer")}");
- writer.AppendLine("{");
- writer.Indent();
- writer.AppendLine("[global::System.Runtime.CompilerServices.ModuleInitializer]");
- writer.AppendLine("public static void Initialize()");
+ writer.AppendLine("internal static partial class TUnit_TestRegistration");
writer.AppendLine("{");
writer.Indent();
- writer.AppendLine($"global::TUnit.Core.SourceRegistrar.Register({GenerateTypeReference(testMethod.TypeSymbol, testMethod.IsGenericType)}, new {uniqueClassName}());");
- writer.Unindent();
- writer.AppendLine("}");
+ writer.AppendLine($"static readonly int _r_{fieldName} = {registrarCall}");
writer.Unindent();
writer.AppendLine("}");
}
@@ -3023,17 +3027,11 @@ private static void GeneratePerClassTestSource(SourceProductionContext context,
writer.Unindent();
writer.AppendLine("}");
- // ModuleInitializer — registers via delegates (no .ctor allocation)
- writer.AppendLine("[global::System.Runtime.CompilerServices.ModuleInitializer]");
- writer.AppendLine("internal static void Initialize()");
- writer.AppendLine("{");
- writer.Indent();
- writer.AppendLine($"global::TUnit.Core.SourceRegistrar.Register(typeof({classGroup.ClassFullyQualified}), {classGroup.TestSourceName}.GetTests, {classGroup.TestSourceName}.EnumerateTestDescriptors);");
writer.Unindent();
writer.AppendLine("}");
- writer.Unindent();
- writer.AppendLine("}");
+ EmitRegistrationField(writer, classGroup.TestSourceName,
+ $"global::TUnit.Core.SourceRegistrar.RegisterReturn(typeof({classGroup.ClassFullyQualified}), {classGroup.TestSourceName}.GetTests, {classGroup.TestSourceName}.EnumerateTestDescriptors);");
context.AddSource($"{classGroup.TestSourceName}.g.cs", SourceText.From(writer.ToString(), Encoding.UTF8));
}
diff --git a/TUnit.Core/SourceRegistrar.cs b/TUnit.Core/SourceRegistrar.cs
index 6e110c663a..5383441dd3 100644
--- a/TUnit.Core/SourceRegistrar.cs
+++ b/TUnit.Core/SourceRegistrar.cs
@@ -96,4 +96,25 @@ public static void RegisterProperty(IPropertySource propertySource)
{
Sources.PropertySources.Enqueue(propertySource);
}
+
+ ///
+ /// Wrapper around that returns a dummy value for use as a field initializer.
+ ///
+ public static int RegisterReturn(Type testClassType, ITestSource testSource)
+ {
+ Register(testClassType, testSource);
+ return 0;
+ }
+
+ ///
+ /// Wrapper around that returns a dummy value for use as a field initializer.
+ ///
+ public static int RegisterReturn(
+ Type testClassType,
+ Func> getTests,
+ Func> enumerateDescriptors)
+ {
+ Register(testClassType, getTests, enumerateDescriptors);
+ return 0;
+ }
}
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 b7877e01ac..3b901d9656 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
@@ -1269,6 +1269,8 @@ namespace
public static void RegisterDynamic(.IDynamicTestSource testSource) { }
public static void RegisterGlobalInitializer(<.> initializer) { }
public static void RegisterProperty(..IPropertySource propertySource) { }
+ public static int RegisterReturn( testClassType, ..ITestSource testSource) { }
+ public static int RegisterReturn( testClassType, > getTests, <.<.TestDescriptor>> enumerateDescriptors) { }
}
public static class Sources
{
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 e71ba56dfd..b62b0b97a1 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
@@ -1269,6 +1269,8 @@ namespace
public static void RegisterDynamic(.IDynamicTestSource testSource) { }
public static void RegisterGlobalInitializer(<.> initializer) { }
public static void RegisterProperty(..IPropertySource propertySource) { }
+ public static int RegisterReturn( testClassType, ..ITestSource testSource) { }
+ public static int RegisterReturn( testClassType, > getTests, <.<.TestDescriptor>> enumerateDescriptors) { }
}
public static class Sources
{
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 70ae813e0c..4433481e18 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
@@ -1269,6 +1269,8 @@ namespace
public static void RegisterDynamic(.IDynamicTestSource testSource) { }
public static void RegisterGlobalInitializer(<.> initializer) { }
public static void RegisterProperty(..IPropertySource propertySource) { }
+ public static int RegisterReturn( testClassType, ..ITestSource testSource) { }
+ public static int RegisterReturn( testClassType, > getTests, <.<.TestDescriptor>> enumerateDescriptors) { }
}
public static class Sources
{
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 4290a16f46..3a8a4aa5bf 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
@@ -1224,6 +1224,8 @@ namespace
public static void RegisterDynamic(.IDynamicTestSource testSource) { }
public static void RegisterGlobalInitializer(<.> initializer) { }
public static void RegisterProperty(..IPropertySource propertySource) { }
+ public static int RegisterReturn( testClassType, ..ITestSource testSource) { }
+ public static int RegisterReturn( testClassType, > getTests, <.<.TestDescriptor>> enumerateDescriptors) { }
}
public static class Sources
{
From cb97b8323cdde614a3f1dcb51417de74a1a1bd58 Mon Sep 17 00:00:00 2001
From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com>
Date: Sun, 22 Mar 2026 15:53:49 +0000
Subject: [PATCH 2/5] perf: consolidate hook module initializers into single
.cctor
Apply the same partial-class field initializer pattern to
HookMetadataGenerator. Each hook's Initialize() method now returns int
and is called from a field initializer on TUnit_HookRegistration,
eliminating ~2000 additional [ModuleInitializer] methods at 100k scale.
Combined with the test registration consolidation, this reduces total
module initializers from ~5000 to 1 (the infrastructure trigger only).
---
.../AssemblyAfterTests.Test.verified.txt | 1136 ++++++++--------
.../AssemblyBeforeTests.Test.verified.txt | 1136 ++++++++--------
...nflictingNamespace.DotNet10_0.verified.txt | 1130 +++++++++-------
...onflictingNamespace.DotNet8_0.verified.txt | 1130 +++++++++-------
...onflictingNamespace.DotNet9_0.verified.txt | 1130 +++++++++-------
...thConflictingNamespace.Net4_7.verified.txt | 1130 +++++++++-------
...mpilesSuccessfully.DotNet10_0.verified.txt | 7 +
...ompilesSuccessfully.DotNet8_0.verified.txt | 7 +
...ompilesSuccessfully.DotNet9_0.verified.txt | 7 +
...s_CompilesSuccessfully.Net4_7.verified.txt | 7 +
...obalStaticAfterEachTests.Test.verified.txt | 1150 +++++++++--------
...balStaticBeforeEachTests.Test.verified.txt | 1150 +++++++++--------
...oksTests.DisposableFieldTests.verified.txt | 156 ++-
.../CodeGenerators/InfrastructureGenerator.cs | 17 +-
.../Generators/HookMetadataGenerator.cs | 24 +-
15 files changed, 5198 insertions(+), 4119 deletions(-)
diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt
index 9d80513d73..00151e57d3 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt
@@ -15,50 +15,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
- Name = "AfterAll1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
- Name = "AssemblyBase1",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterAll1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_0Params_Body,
- FilePath = @"",
- LineNumber = 5
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
+ Name = "AssemblyBase1",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_0Params_Body,
+ FilePath = @"",
+ LineNumber = 5
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_Assembly.TUnit_TestProject_AfterTests_AssemblyBase1_AfterAll1_After_AssemblyInitializer.Initialize();
}
}
@@ -82,49 +91,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
- Name = "AfterEach1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
- Name = "AssemblyBase1",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterEach1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1)),
+ Name = "AssemblyBase1",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase1)instance;
+ await AsyncConvert.Convert(() => typedInstance.AfterEach1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase1)instance;
- await AsyncConvert.Convert(() => typedInstance.AfterEach1());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_Test.TUnit_TestProject_AfterTests_AssemblyBase1_AfterEach1_After_TestInitializer.Initialize();
}
}
@@ -148,50 +166,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
- Name = "AfterAll2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
- Name = "AssemblyBase2",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterAll2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_0Params_Body,
- FilePath = @"",
- LineNumber = 20
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
+ Name = "AssemblyBase2",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_0Params_Body,
+ FilePath = @"",
+ LineNumber = 20
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_Assembly.TUnit_TestProject_AfterTests_AssemblyBase2_AfterAll2_After_AssemblyInitializer.Initialize();
}
}
@@ -215,49 +242,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
- Name = "AfterEach2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
- Name = "AssemblyBase2",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterEach2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2)),
+ Name = "AssemblyBase2",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase2)instance;
+ await AsyncConvert.Convert(() => typedInstance.AfterEach2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase2)instance;
- await AsyncConvert.Convert(() => typedInstance.AfterEach2());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_Test.TUnit_TestProject_AfterTests_AssemblyBase2_AfterEach2_After_TestInitializer.Initialize();
}
}
@@ -281,50 +317,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
- Name = "AfterAll3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
- Name = "AssemblyBase3",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterAll3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_0Params_Body,
- FilePath = @"",
- LineNumber = 35
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
+ Name = "AssemblyBase3",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_0Params_Body,
+ FilePath = @"",
+ LineNumber = 35
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_Assembly.TUnit_TestProject_AfterTests_AssemblyBase3_AfterAll3_After_AssemblyInitializer.Initialize();
}
}
@@ -348,49 +393,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
- Name = "AfterEach3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
- Name = "AssemblyBase3",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterEach3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3)),
+ Name = "AssemblyBase3",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase3)instance;
+ await AsyncConvert.Convert(() => typedInstance.AfterEach3());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyBase3)instance;
- await AsyncConvert.Convert(() => typedInstance.AfterEach3());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_Test.TUnit_TestProject_AfterTests_AssemblyBase3_AfterEach3_After_TestInitializer.Initialize();
}
}
@@ -414,50 +468,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AfterAllCleanUp",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterAllCleanUp",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_0Params_Body,
- FilePath = @"",
- LineNumber = 50
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_0Params_Body,
+ FilePath = @"",
+ LineNumber = 50
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_Assembly.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp_After_AssemblyInitializer.Initialize();
}
}
@@ -481,53 +544,62 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AfterAllCleanUpWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext_1Params_Body,
- FilePath = @"",
- LineNumber = 56
- }
- );
+ Name = "AfterAllCleanUpWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext_1Params_Body,
+ FilePath = @"",
+ LineNumber = 56
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext_1Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context));
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext_1Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context));
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_Assembly.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContext__AssemblyHookContext_After_AssemblyInitializer.Initialize();
}
}
@@ -551,50 +623,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AfterAllCleanUp2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "AfterAllCleanUp2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_0Params_Body,
- FilePath = @"",
- LineNumber = 62
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_0Params_Body,
+ FilePath = @"",
+ LineNumber = 62
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp2());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_Assembly.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUp2_After_AssemblyInitializer.Initialize();
}
}
@@ -618,54 +699,63 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_Assembly;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
- global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
- new AfterAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).Assembly;
+ global::TUnit.Core.Sources.AfterAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterAssemblyHooks[TestsBase`1_assembly].Add(
+ new AfterAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AfterAllCleanUpWithContextAndToken",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContextAndToken", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContextAndToken", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken_2Params_Body,
- FilePath = @"",
- LineNumber = 68
- }
- );
+ Name = "AfterAllCleanUpWithContextAndToken",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContextAndToken", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContextAndToken", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken_2Params_Body,
+ FilePath = @"",
+ LineNumber = 68
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken_2Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContextAndToken(context, cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken_2Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContextAndToken(context, cancellationToken));
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_Assembly.TUnit_TestProject_AfterTests_AssemblyCleanupTests_AfterAllCleanUpWithContextAndToken__AssemblyHookContext_CancellationToken_After_AssemblyInitializer.Initialize();
}
}
@@ -689,49 +779,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "Cleanup",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "Cleanup",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.Cleanup());
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.Cleanup());
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_Test.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_After_TestInitializer.Initialize();
}
}
@@ -755,52 +854,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "Cleanup",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("Cleanup", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_1Params_Body
- }
- );
+ Name = "Cleanup",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("Cleanup", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_1Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.Cleanup(cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.Cleanup(cancellationToken));
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_Test.TUnit_TestProject_AfterTests_AssemblyCleanupTests_Cleanup__CancellationToken_After_TestInitializer.Initialize();
}
}
@@ -824,52 +932,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "CleanupWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_1Params_Body
- }
- );
+ Name = "CleanupWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_1Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.CleanupWithContext(context));
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.CleanupWithContext(context));
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_Test.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_After_TestInitializer.Initialize();
}
}
@@ -893,52 +1010,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_Test;
-internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_TestInitializer
{
- global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.AfterTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.AfterTestHooks[typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "CleanupWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
- Name = "AssemblyCleanupTests",
- Namespace = "TUnit.TestProject.AfterTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
- Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_2Params_Body
- }
- );
+ Name = "CleanupWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.AfterTests.AssemblyCleanupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)),
+ Name = "AssemblyCleanupTests",
+ Namespace = "TUnit.TestProject.AfterTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextAfterTestHookIndex(),
+ Body = global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_2Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_2Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.CleanupWithContext(context, cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext_2Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.AfterTests.AssemblyCleanupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.CleanupWithContext(context, cancellationToken));
+ static readonly int _h_TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_Test.TUnit_TestProject_AfterTests_AssemblyCleanupTests_CleanupWithContext__TestContext_CancellationToken_After_TestInitializer.Initialize();
}
}
diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt
index fbf2224b0c..54b3eefb72 100644
--- a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt
@@ -15,50 +15,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
- Name = "BeforeAll1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
- Name = "AssemblyBase1",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_0Params_Body,
- FilePath = @"",
- LineNumber = 5
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
+ Name = "AssemblyBase1",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_0Params_Body,
+ FilePath = @"",
+ LineNumber = 5
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeAll1_Before_AssemblyInitializer.Initialize();
}
}
@@ -82,49 +91,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
- Name = "BeforeEach1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
- Name = "AssemblyBase1",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1)),
+ Name = "AssemblyBase1",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase1)instance;
+ await AsyncConvert.Convert(() => typedInstance.BeforeEach1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase1)instance;
- await AsyncConvert.Convert(() => typedInstance.BeforeEach1());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_Test.TUnit_TestProject_BeforeTests_AssemblyBase1_BeforeEach1_Before_TestInitializer.Initialize();
}
}
@@ -148,50 +166,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
- Name = "BeforeAll2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
- Name = "AssemblyBase2",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_0Params_Body,
- FilePath = @"",
- LineNumber = 20
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
+ Name = "AssemblyBase2",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_0Params_Body,
+ FilePath = @"",
+ LineNumber = 20
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeAll2_Before_AssemblyInitializer.Initialize();
}
}
@@ -215,49 +242,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
- Name = "BeforeEach2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
- Name = "AssemblyBase2",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2)),
+ Name = "AssemblyBase2",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase2)instance;
+ await AsyncConvert.Convert(() => typedInstance.BeforeEach2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase2)instance;
- await AsyncConvert.Convert(() => typedInstance.BeforeEach2());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_Test.TUnit_TestProject_BeforeTests_AssemblyBase2_BeforeEach2_Before_TestInitializer.Initialize();
}
}
@@ -281,50 +317,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
- Name = "BeforeAll3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
- Name = "AssemblyBase3",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_0Params_Body,
- FilePath = @"",
- LineNumber = 35
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
+ Name = "AssemblyBase3",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_0Params_Body,
+ FilePath = @"",
+ LineNumber = 35
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeAll3_Before_AssemblyInitializer.Initialize();
}
}
@@ -348,49 +393,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
- Name = "BeforeEach3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
- Name = "AssemblyBase3",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblyBase3", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3)),
+ Name = "AssemblyBase3",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase3)instance;
+ await AsyncConvert.Convert(() => typedInstance.BeforeEach3());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblyBase3)instance;
- await AsyncConvert.Convert(() => typedInstance.BeforeEach3());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_Test.TUnit_TestProject_BeforeTests_AssemblyBase3_BeforeEach3_Before_TestInitializer.Initialize();
}
}
@@ -414,50 +468,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "BeforeAllSetUp",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAllSetUp",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_0Params_Body,
- FilePath = @"",
- LineNumber = 50
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_0Params_Body,
+ FilePath = @"",
+ LineNumber = 50
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp_Before_AssemblyInitializer.Initialize();
}
}
@@ -481,53 +544,62 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "BeforeAllSetUpWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_1Params_Body,
- FilePath = @"",
- LineNumber = 56
- }
- );
+ Name = "BeforeAllSetUpWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_1Params_Body,
+ FilePath = @"",
+ LineNumber = 56
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_1Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context));
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_1Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context));
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_Before_AssemblyInitializer.Initialize();
}
}
@@ -551,50 +623,59 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "BeforeAllSetUp2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAllSetUp2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_0Params_Body,
- FilePath = @"",
- LineNumber = 62
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_0Params_Body,
+ FilePath = @"",
+ LineNumber = 62
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_0Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp2());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUp2_Before_AssemblyInitializer.Initialize();
}
}
@@ -618,54 +699,63 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_Assembly;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_AssemblyInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_Assembly
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_AssemblyInitializer
{
- var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
- global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
- new BeforeAssemblyHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ var TestsBase`1_assembly = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).Assembly;
+ global::TUnit.Core.Sources.BeforeAssemblyHooks.GetOrAdd(TestsBase`1_assembly, static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeAssemblyHooks[TestsBase`1_assembly].Add(
+ new BeforeAssemblyHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "BeforeAllSetUpWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_2Params_Body,
- FilePath = @"",
- LineNumber = 68
- }
- );
+ Name = "BeforeAllSetUpWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.AssemblyHookContext), "context", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.AssemblyHookContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Static, null, new global::System.Type[] { typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeAssemblyHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_2Params_Body,
+ FilePath = @"",
+ LineNumber = 68
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_2Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext_2Params_Body(AssemblyHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken));
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_Assembly = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_Assembly.TUnit_TestProject_BeforeTests_AssemblySetupTests_BeforeAllSetUpWithContext__AssemblyHookContext_CancellationToken_Before_AssemblyInitializer.Initialize();
}
}
@@ -689,49 +779,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "Setup",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "Setup",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.Setup());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.Setup());
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_Test.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_Before_TestInitializer.Initialize();
}
}
@@ -755,52 +854,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "Setup",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("Setup", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_1Params_Body
- }
- );
+ Name = "Setup",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("Setup", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_1Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.Setup(cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.Setup(cancellationToken));
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_Test.TUnit_TestProject_BeforeTests_AssemblySetupTests_Setup__CancellationToken_Before_TestInitializer.Initialize();
}
}
@@ -824,52 +932,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "SetupWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext) }, null)!.GetParameters()[0])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_1Params_Body
- }
- );
+ Name = "SetupWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext) }, null)!.GetParameters()[0])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_1Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.SetupWithContext(context));
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_1Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.SetupWithContext(context));
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_Test.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_Before_TestInitializer.Initialize();
}
}
@@ -893,52 +1010,61 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "SetupWithContext",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = new global::TUnit.Core.ParameterMetadata[]
- {
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
- global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
- },
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
- Name = "AssemblySetupTests",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
- Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_2Params_Body
- }
- );
+ Name = "SetupWithContext",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
+ Parameters = new global::TUnit.Core.ParameterMetadata[]
+ {
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::TUnit.Core.TestContext), "testContext", new global::TUnit.Core.ConcreteType(typeof(global::TUnit.Core.TestContext)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[0]),
+ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(global::System.Threading.CancellationToken), "cancellationToken", new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.CancellationToken)), false, reflectionInfoFactory: static () => typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, new global::System.Type[] { typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken) }, null)!.GetParameters()[1])
+ },
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.AssemblySetupTests", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests)),
+ Name = "AssemblySetupTests",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_2Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_2Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
+ await AsyncConvert.Convert(() => typedInstance.SetupWithContext(context, cancellationToken));
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext_2Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.AssemblySetupTests)instance;
- await AsyncConvert.Convert(() => typedInstance.SetupWithContext(context, cancellationToken));
+ static readonly int _h_TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_Test.TUnit_TestProject_BeforeTests_AssemblySetupTests_SetupWithContext__TestContext_CancellationToken_Before_TestInitializer.Initialize();
}
}
diff --git a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.HooksTest_WithConflictingNamespace.DotNet10_0.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.HooksTest_WithConflictingNamespace.DotNet10_0.verified.txt
index ea0821d0d9..2650827c6c 100644
--- a/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.HooksTest_WithConflictingNamespace.DotNet10_0.verified.txt
+++ b/TUnit.Core.SourceGenerator.Tests/ConflictingNamespaceTests.HooksTest_WithConflictingNamespace.DotNet10_0.verified.txt
@@ -15,49 +15,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_Class;
-internal static class TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_ClassInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_Class
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_ClassInitializer
{
- global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base1)].Add(
- new BeforeClassHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base1)].Add(
+ new BeforeClassHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
- Name = "BeforeAll1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base1", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
- Name = "Base1",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_Base1_BeforeAll1_0Params_Body,
- FilePath = @"",
- LineNumber = 5
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
+ Name = "Base1",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_Base1_BeforeAll1_0Params_Body,
+ FilePath = @"",
+ LineNumber = 5
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_Base1_BeforeAll1_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_Base1_BeforeAll1_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1());
+ static readonly int _h_TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_Class = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_Class.TUnit_TestProject_BeforeTests_Base1_BeforeAll1_Before_ClassInitializer.Initialize();
}
}
@@ -81,49 +90,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base1)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base1),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base1), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base1)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
- Name = "BeforeEach1",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base1", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base1),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
- Name = "Base1",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach1",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_Base1_BeforeEach1_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base1", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.Base1),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base1)),
+ Name = "Base1",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_Base1_BeforeEach1_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_Base1_BeforeEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.Base1)instance;
+ await AsyncConvert.Convert(() => typedInstance.BeforeEach1());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_Base1_BeforeEach1_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.Base1)instance;
- await AsyncConvert.Convert(() => typedInstance.BeforeEach1());
+ static readonly int _h_TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_Test.TUnit_TestProject_BeforeTests_Base1_BeforeEach1_Before_TestInitializer.Initialize();
}
}
@@ -147,49 +165,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_Class;
-internal static class TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_ClassInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_Class
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_ClassInitializer
{
- global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base2)].Add(
- new BeforeClassHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base2)].Add(
+ new BeforeClassHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
- Name = "BeforeAll2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base2", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
- Name = "Base2",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_Base2_BeforeAll2_0Params_Body,
- FilePath = @"",
- LineNumber = 20
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
+ Name = "Base2",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_Base2_BeforeAll2_0Params_Body,
+ FilePath = @"",
+ LineNumber = 20
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_Base2_BeforeAll2_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_Base2_BeforeAll2_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2());
+ static readonly int _h_TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_Class = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_Class.TUnit_TestProject_BeforeTests_Base2_BeforeAll2_Before_ClassInitializer.Initialize();
}
}
@@ -213,49 +240,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base2)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base2),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base2), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base2)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
- Name = "BeforeEach2",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base2", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base2),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
- Name = "Base2",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach2",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_Base2_BeforeEach2_0Params_Body
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base2", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.Base2),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base2)),
+ Name = "Base2",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeTestHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_Base2_BeforeEach2_0Params_Body
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_Base2_BeforeEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+ {
+ var typedInstance = (global::TUnit.TestProject.BeforeTests.Base2)instance;
+ await AsyncConvert.Convert(() => typedInstance.BeforeEach2());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_Base2_BeforeEach2_0Params_Body(object instance, TestContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- var typedInstance = (global::TUnit.TestProject.BeforeTests.Base2)instance;
- await AsyncConvert.Convert(() => typedInstance.BeforeEach2());
+ static readonly int _h_TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_Test = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_Test.TUnit_TestProject_BeforeTests_Base2_BeforeEach2_Before_TestInitializer.Initialize();
}
}
@@ -279,49 +315,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_Class;
-internal static class TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_ClassInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_Class
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_ClassInitializer
{
- global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base3)].Add(
- new BeforeClassHookMethod
- {
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeClassHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeClassHooks[typeof(global::TUnit.TestProject.BeforeTests.Base3)].Add(
+ new BeforeClassHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base3)),
- Name = "BeforeAll3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base3", new global::TUnit.Core.ClassMetadata
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base3)),
- Name = "Base3",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeAll3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty(),
- Parent = null
- })
- },
- HookExecutor = DefaultExecutor.Instance,
- Order = 0,
- RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
- Body = global_TUnit_TestProject_BeforeTests_Base3_BeforeAll3_0Params_Body,
- FilePath = @"",
- LineNumber = 35
- }
- );
+ Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base3", new global::TUnit.Core.ClassMetadata
+ {
+ Type = typeof(global::TUnit.TestProject.BeforeTests.Base3),
+ TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base3)),
+ Name = "Base3",
+ Namespace = "TUnit.TestProject.BeforeTests",
+ Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Parameters = global::System.Array.Empty(),
+ Properties = global::System.Array.Empty(),
+ Parent = null
+ })
+ },
+ HookExecutor = DefaultExecutor.Instance,
+ Order = 0,
+ RegistrationIndex = global::TUnit.Core.HookRegistrationIndices.GetNextBeforeClassHookIndex(),
+ Body = global_TUnit_TestProject_BeforeTests_Base3_BeforeAll3_0Params_Body,
+ FilePath = @"",
+ LineNumber = 35
+ }
+ );
+ return 0;
+ }
+ private static async ValueTask global_TUnit_TestProject_BeforeTests_Base3_BeforeAll3_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+ {
+ await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3());
+ }
}
- private static async ValueTask global_TUnit_TestProject_BeforeTests_Base3_BeforeAll3_0Params_Body(ClassHookContext context, CancellationToken cancellationToken)
+}
+namespace TUnit.Generated
+{
+ internal static partial class TUnit_HookRegistration
{
- await AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3());
+ static readonly int _h_TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_Class = global::TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_Class.TUnit_TestProject_BeforeTests_Base3_BeforeAll3_Before_ClassInitializer.Initialize();
}
}
@@ -345,49 +390,58 @@ using global::TUnit.Core.Hooks;
using global::TUnit.Core.Interfaces.SourceGenerator;
using global::TUnit.Core.Models;
using HookType = global::TUnit.Core.HookType;
-namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base3_BeforeEach3_Before_Test;
-internal static class TUnit_TestProject_BeforeTests_Base3_BeforeEach3_Before_TestInitializer
+namespace TUnit.Generated.Hooks.TUnit_TestProject_BeforeTests_Base3_BeforeEach3_Before_Test
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
- public static void Initialize()
+ internal static class TUnit_TestProject_BeforeTests_Base3_BeforeEach3_Before_TestInitializer
{
- global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
- global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base3)].Add(
- new InstanceHookMethod
- {
- InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base3),
- MethodInfo = new global::TUnit.Core.MethodMetadata
+ public static int Initialize()
+ {
+ global::TUnit.Core.Sources.BeforeTestHooks.GetOrAdd(typeof(global::TUnit.TestProject.BeforeTests.Base3), static _ => new global::System.Collections.Concurrent.ConcurrentBag());
+ global::TUnit.Core.Sources.BeforeTestHooks[typeof(global::TUnit.TestProject.BeforeTests.Base3)].Add(
+ new InstanceHookMethod
{
- Type = typeof(global::TUnit.TestProject.BeforeTests.Base3),
- TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base3)),
- Name = "BeforeEach3",
- GenericTypeCount = 0,
- ReturnType = typeof(global::System.Threading.Tasks.Task),
- ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
- Parameters = global::System.Array.Empty(),
- Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BeforeTests.Base3", new global::TUnit.Core.ClassMetadata
+ InitClassType = typeof(global::TUnit.TestProject.BeforeTests.Base3),
+ MethodInfo = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BeforeTests.Base3),
TypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::TUnit.TestProject.BeforeTests.Base3)),
- Name = "Base3",
- Namespace = "TUnit.TestProject.BeforeTests",
- Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", "TestsBase`1"),
+ Name = "BeforeEach3",
+ GenericTypeCount = 0,
+ ReturnType = typeof(global::System.Threading.Tasks.Task),
+ ReturnTypeInfo = new global::TUnit.Core.ConcreteType(typeof(global::System.Threading.Tasks.Task)),
Parameters = global::System.Array.Empty(),
- Properties = global::System.Array.Empty