From ba751688ae28e776537dc7f717b1a64684ee027b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 19 Dec 2024 18:48:11 -0700 Subject: [PATCH 01/71] Add .NET Standard 2.0 target --- Directory.Build.props | 6 +- Directory.Packages.props | 2 + Polyfill.props | 14 + TUnit.Assertions/Assert.cs | 4 +- .../Connectors/AndAssertCondition.cs | 4 +- .../Connectors/OrAssertCondition.cs | 4 +- .../DateOnlyEqualToAssertionBuilderWrapper.cs | 8 +- .../TimeOnlyEqualToAssertionBuilderWrapper.cs | 8 +- TUnit.Assertions/AssertionScope.cs | 2 +- ...eOnlyEqualsExpectedValueAssertCondition.cs | 8 +- ...eOnlyEqualsExpectedValueAssertCondition.cs | 8 +- .../Chronology/DateOnlyIsExtensions.cs | 6 +- .../Chronology/TimeOnlyIsExtensions.cs | 6 +- ...quivalentToExpectedValueAssertCondition.cs | 4 +- ...quivalentToExpectedValueAssertCondition.cs | 2 +- .../Collections/DoesExtensions_Dictionary.cs | 4 +- .../DoesNotExtensions_Dictionary.cs | 4 +- ...ssignableToExpectedValueAssertCondition.cs | 2 +- .../EqualsExpectedValueAssertCondition.cs | 5 +- ...quivalentToExpectedValueAssertCondition.cs | 4 +- ...ssignableToExpectedValueAssertCondition.cs | 2 +- .../Assertions/Numbers/NumberIsExtensions.cs | 6 +- .../Numbers/NumberIsNotExtensions.cs | 6 +- .../Strings/DoesExtensions_String.cs | 4 +- .../Strings/DoesNotExtensions_String.cs | 4 +- .../Throws/ThrowsOfTypeAssertCondition.cs | 2 +- TUnit.Assertions/Compare.cs | 6 +- .../Equality/EquivalentToEqualityComparer.cs | 6 +- TUnit.Assertions/ExceptionsHelper.cs | 2 +- .../Extensions/NumberExtensions.cs | 8 +- TUnit.Assertions/Helpers/Formatter.cs | 2 + TUnit.Assertions/StringUtils.cs | 34 +-- TUnit.Assertions/TUnit.Assertions.csproj | 20 +- TUnit.Core/AsyncEvent.cs | 7 +- .../Executors/TestExecutorAttribute.cs | 4 +- .../Attributes/ParallelGroupAttribute.cs | 2 + .../Attributes/ParallelLimiterAttribute.cs | 4 +- .../ArgumentDisplayFormatterAttribute.cs | 2 + .../Attributes/TestData/ClassDataSources.cs | 4 + .../TestMetadata/CategoryAttribute.cs | 2 + .../DisplayNameFormatterAttribute.cs | 2 + .../TestMetadata/PropertyAttribute.cs | 2 + .../Attributes/TestMetadata/RetryAttribute.cs | 2 + .../TestMetadata/TimeoutAttribute.cs | 2 + TUnit.Core/Data/GetOnlyDictionary.cs | 6 +- .../Extensions/TestContextExtensions.cs | 8 +- TUnit.Core/Interfaces/IEventReceiver.cs | 4 + .../Interfaces/ITestStartEventReceiver.cs | 8 +- TUnit.Core/Models/LazyHook.cs | 4 + TUnit.Core/RunHelpers.cs | 18 +- TUnit.Core/TUnit.Core.csproj | 11 +- TUnit.Core/TestContextEvents.cs | 22 +- TUnit.Core/TestDataContainer.cs | 4 + TUnit.Engine/Capabilities/BannerCapability.cs | 4 + .../Extensions/TestContextExtensions.cs | 2 +- .../Framework/TUnitServiceProvider.cs | 10 +- TUnit.Engine/Helpers/ExceptionsHelper.cs | 2 +- .../Hooks/AssemblyHookOrchestrator.cs | 2 +- TUnit.Engine/Hooks/ClassHookOrchestrator.cs | 2 +- TUnit.Engine/Logging/ConsoleInterceptor.cs | 74 ++--- TUnit.Engine/PolyfillExtensions.cs | 261 ++++++++++++++++++ TUnit.Engine/PriorityQueue.cs | 54 ++++ TUnit.Engine/Services/Counter.cs | 6 +- TUnit.Engine/Services/OnEndExecutor.cs | 3 +- TUnit.Engine/Services/SingleTestExecutor.cs | 16 +- TUnit.Engine/Services/TestsExecutor.cs | 45 ++- TUnit.Engine/TUnit.Engine.csproj | 6 +- TUnit.Engine/Verify.cs | 15 + TUnit.TestProject/TUnit.TestProject.csproj | 10 +- .../TUnitTimer/TUnitTimer/TUnitTimer.csproj | 4 +- 70 files changed, 681 insertions(+), 160 deletions(-) create mode 100644 Polyfill.props create mode 100644 TUnit.Engine/PolyfillExtensions.cs create mode 100644 TUnit.Engine/PriorityQueue.cs create mode 100644 TUnit.Engine/Verify.cs diff --git a/Directory.Build.props b/Directory.Build.props index d8d4791c54..b1f6a76072 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ net8.0 net8.0;net9.0 - + enable enable latest @@ -84,5 +84,5 @@ - - \ No newline at end of file + + diff --git a/Directory.Packages.props b/Directory.Packages.props index 7a350b9d7d..5f9a63d25c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,6 +6,7 @@ + @@ -50,6 +51,7 @@ + diff --git a/Polyfill.props b/Polyfill.props new file mode 100644 index 0000000000..3897b8c91c --- /dev/null +++ b/Polyfill.props @@ -0,0 +1,14 @@ + + + $(TargetFrameworks);netstandard2.0 + true + + + + + + + + + + diff --git a/TUnit.Assertions/Assert.cs b/TUnit.Assertions/Assert.cs index 66ffd63be2..c03dfa542b 100644 --- a/TUnit.Assertions/Assert.cs +++ b/TUnit.Assertions/Assert.cs @@ -97,7 +97,7 @@ public static async Task ThrowsAsync(Type type, Func @delegate, { await @delegate(); } - catch (Exception e) when (e.GetType().IsAssignableTo(type)) + catch (Exception e) when (type.IsAssignableFrom(e.GetType())) { return e; } @@ -121,7 +121,7 @@ public static Exception Throws(Type type, Action @delegate, [CallerArgumentExpre { @delegate(); } - catch (Exception e) when (e.GetType().IsAssignableTo(type)) + catch (Exception e) when (type.IsAssignableFrom(e.GetType())) { return e; } diff --git a/TUnit.Assertions/AssertConditions/Connectors/AndAssertCondition.cs b/TUnit.Assertions/AssertConditions/Connectors/AndAssertCondition.cs index 201576c9c0..edf1a5a815 100644 --- a/TUnit.Assertions/AssertConditions/Connectors/AndAssertCondition.cs +++ b/TUnit.Assertions/AssertConditions/Connectors/AndAssertCondition.cs @@ -7,8 +7,8 @@ internal class AndAssertCondition : BaseAssertCondition public AndAssertCondition(BaseAssertCondition condition1, BaseAssertCondition condition2) { - ArgumentNullException.ThrowIfNull(condition1); - ArgumentNullException.ThrowIfNull(condition2); + Verify.ArgNotNull(condition1); + Verify.ArgNotNull(condition2); _condition1 = condition1; _condition2 = condition2; diff --git a/TUnit.Assertions/AssertConditions/Connectors/OrAssertCondition.cs b/TUnit.Assertions/AssertConditions/Connectors/OrAssertCondition.cs index 56327e7aed..84bb66f2da 100644 --- a/TUnit.Assertions/AssertConditions/Connectors/OrAssertCondition.cs +++ b/TUnit.Assertions/AssertConditions/Connectors/OrAssertCondition.cs @@ -7,8 +7,8 @@ internal class OrAssertCondition : BaseAssertCondition public OrAssertCondition(BaseAssertCondition condition1, BaseAssertCondition condition2) { - ArgumentNullException.ThrowIfNull(condition1); - ArgumentNullException.ThrowIfNull(condition2); + Verify.ArgNotNull(condition1); + Verify.ArgNotNull(condition2); _condition1 = condition1; _condition2 = condition2; diff --git a/TUnit.Assertions/AssertionBuilders/Wrappers/DateOnlyEqualToAssertionBuilderWrapper.cs b/TUnit.Assertions/AssertionBuilders/Wrappers/DateOnlyEqualToAssertionBuilderWrapper.cs index 5c5027eb10..e670b8e2e4 100644 --- a/TUnit.Assertions/AssertionBuilders/Wrappers/DateOnlyEqualToAssertionBuilderWrapper.cs +++ b/TUnit.Assertions/AssertionBuilders/Wrappers/DateOnlyEqualToAssertionBuilderWrapper.cs @@ -1,4 +1,6 @@ -using System.Runtime.CompilerServices; +#if NET + +using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions.Chronology; namespace TUnit.Assertions.AssertionBuilders.Wrappers; @@ -19,4 +21,6 @@ public DateOnlyEqualToAssertionBuilderWrapper WithinDays(int days, [CallerArgume return this; } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/AssertionBuilders/Wrappers/TimeOnlyEqualToAssertionBuilderWrapper.cs b/TUnit.Assertions/AssertionBuilders/Wrappers/TimeOnlyEqualToAssertionBuilderWrapper.cs index b3f0ab7c7c..3c58865172 100644 --- a/TUnit.Assertions/AssertionBuilders/Wrappers/TimeOnlyEqualToAssertionBuilderWrapper.cs +++ b/TUnit.Assertions/AssertionBuilders/Wrappers/TimeOnlyEqualToAssertionBuilderWrapper.cs @@ -1,4 +1,6 @@ -using System.Runtime.CompilerServices; +#if NET + +using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions.Chronology; namespace TUnit.Assertions.AssertionBuilders.Wrappers; @@ -19,4 +21,6 @@ public TimeOnlyEqualToAssertionBuilderWrapper Within(TimeSpan tolerance, [Caller return this; } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/AssertionScope.cs b/TUnit.Assertions/AssertionScope.cs index 0055749a9f..7406ca06ad 100644 --- a/TUnit.Assertions/AssertionScope.cs +++ b/TUnit.Assertions/AssertionScope.cs @@ -52,7 +52,7 @@ public void Dispose() // In which case it should just throw itself, so we don't need to do that if (_exceptions.Count == 1) { - ExceptionDispatchInfo.Throw(_exceptions[0]); + ExceptionDispatchInfo.Capture(_exceptions[0]).Throw(); } if (_exceptions.Count > 1) diff --git a/TUnit.Assertions/Assertions/Chronology/Conditions/DateOnlyEqualsExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Chronology/Conditions/DateOnlyEqualsExpectedValueAssertCondition.cs index e740bbd508..a8ca314ac0 100644 --- a/TUnit.Assertions/Assertions/Chronology/Conditions/DateOnlyEqualsExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Chronology/Conditions/DateOnlyEqualsExpectedValueAssertCondition.cs @@ -1,4 +1,6 @@ -namespace TUnit.Assertions.AssertConditions.Chronology; +#if NET + +namespace TUnit.Assertions.AssertConditions.Chronology; public class DateOnlyEqualsExpectedValueAssertCondition(DateOnly expected) : ExpectedValueAssertCondition(expected) { @@ -37,4 +39,6 @@ public void SetTolerance(int toleranceDays) { _tolerance = toleranceDays; } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Chronology/Conditions/TimeOnlyEqualsExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Chronology/Conditions/TimeOnlyEqualsExpectedValueAssertCondition.cs index 3aa93b7603..ff6c3273c8 100644 --- a/TUnit.Assertions/Assertions/Chronology/Conditions/TimeOnlyEqualsExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Chronology/Conditions/TimeOnlyEqualsExpectedValueAssertCondition.cs @@ -1,4 +1,6 @@ -namespace TUnit.Assertions.AssertConditions.Chronology; +#if NET + +namespace TUnit.Assertions.AssertConditions.Chronology; public class TimeOnlyEqualsExpectedValueAssertCondition(TimeOnly expected) : ExpectedValueAssertCondition(expected) { @@ -37,4 +39,6 @@ public void SetTolerance(TimeSpan tolerance) { _tolerance = tolerance; } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Chronology/DateOnlyIsExtensions.cs b/TUnit.Assertions/Assertions/Chronology/DateOnlyIsExtensions.cs index 27735715b5..a6d8c206f6 100644 --- a/TUnit.Assertions/Assertions/Chronology/DateOnlyIsExtensions.cs +++ b/TUnit.Assertions/Assertions/Chronology/DateOnlyIsExtensions.cs @@ -1,5 +1,7 @@ #nullable disable +#if NET + using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions; using TUnit.Assertions.AssertConditions.Chronology; @@ -49,4 +51,6 @@ public static InvokableValueAssertionBuilder IsBeforeOrEqualTo(this IV $"to be before or equal to {expected}") , [doNotPopulateThisValue]); } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Chronology/TimeOnlyIsExtensions.cs b/TUnit.Assertions/Assertions/Chronology/TimeOnlyIsExtensions.cs index 50489ad99d..35b46ebe9e 100644 --- a/TUnit.Assertions/Assertions/Chronology/TimeOnlyIsExtensions.cs +++ b/TUnit.Assertions/Assertions/Chronology/TimeOnlyIsExtensions.cs @@ -1,5 +1,7 @@ #nullable disable +#if NET + using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions; using TUnit.Assertions.AssertConditions.Chronology; @@ -63,4 +65,6 @@ public static InvokableValueAssertionBuilder IsBeforeOrEqualTo(this IV $"be before or equal to {expected}") , [doNotPopulateThisValue]); } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs index d0d4c61038..1e4660e10f 100644 --- a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs @@ -9,7 +9,7 @@ public class EnumerableEquivalentToExpectedValueAssertCondition : ExpectedValueAssertCondition>(expected) where TActual : IEnumerable? { - protected override string GetExpectation() => $"to be equivalent to {(expected != null ? string.Join(',', expected) : null)}"; + protected override string GetExpectation() => $"to be equivalent to {(expected != null ? string.Join(",", expected) : null)}"; protected override AssertionResult GetResult(TActual? actualValue, IEnumerable? expectedValue) { @@ -38,7 +38,7 @@ protected override AssertionResult GetResult(TActual? actualValue, IEnumerable "it is not null") .OrFailIf( () => !orderedActual!.SequenceEqual(expectedValue!, equalityComparer), - () => $"it is {string.Join(',', orderedActual!)}" + () => $"it is {string.Join(",", orderedActual!)}" ); } } \ No newline at end of file diff --git a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableNotEquivalentToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableNotEquivalentToExpectedValueAssertCondition.cs index a3187ea554..7bf465e3a7 100644 --- a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableNotEquivalentToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableNotEquivalentToExpectedValueAssertCondition.cs @@ -6,7 +6,7 @@ public class EnumerableNotEquivalentToExpectedValueAssertCondition>(expected) where TActual : IEnumerable? { - protected override string GetExpectation() => $" to be not equivalent to {(expected != null ? string.Join(',', expected) : null)}"; + protected override string GetExpectation() => $" to be not equivalent to {(expected != null ? string.Join(",", expected) : null)}"; protected override AssertionResult GetResult(TActual? actualValue, IEnumerable? expectedValue) { diff --git a/TUnit.Assertions/Assertions/Collections/DoesExtensions_Dictionary.cs b/TUnit.Assertions/Assertions/Collections/DoesExtensions_Dictionary.cs index d9029c3dcd..762b3c5708 100644 --- a/TUnit.Assertions/Assertions/Collections/DoesExtensions_Dictionary.cs +++ b/TUnit.Assertions/Assertions/Collections/DoesExtensions_Dictionary.cs @@ -16,7 +16,7 @@ public static InvokableValueAssertionBuilder ContainsKey(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return actual.Keys.Cast().Contains(expected, equalityComparer); }, (_, _, _) => $"The key \"{expected}\" was not found in the dictionary", @@ -30,7 +30,7 @@ public static InvokableValueAssertionBuilder ContainsValue(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return actual.Values.Cast().Contains(expected, equalityComparer); }, (_, _, _) => $"The value \"{expected}\" was not found in the dictionary", diff --git a/TUnit.Assertions/Assertions/Collections/DoesNotExtensions_Dictionary.cs b/TUnit.Assertions/Assertions/Collections/DoesNotExtensions_Dictionary.cs index a17017d26b..362d290f4c 100644 --- a/TUnit.Assertions/Assertions/Collections/DoesNotExtensions_Dictionary.cs +++ b/TUnit.Assertions/Assertions/Collections/DoesNotExtensions_Dictionary.cs @@ -16,7 +16,7 @@ public static InvokableValueAssertionBuilder DoesNotContainKey(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return !actual.Keys.Cast().Contains(expected, equalityComparer); }, (_, _, _) => $"The key \"{expected}\" was found in the dictionary", @@ -30,7 +30,7 @@ public static InvokableValueAssertionBuilder DoesNotContainValue(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return !actual.Values.Cast().Contains(expected, equalityComparer); }, (_, _, _) => $"The value \"{expected}\" was found in the dictionary", diff --git a/TUnit.Assertions/Assertions/Generics/Conditions/AssignableToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Generics/Conditions/AssignableToExpectedValueAssertCondition.cs index 7419ab83ee..f344530839 100644 --- a/TUnit.Assertions/Assertions/Generics/Conditions/AssignableToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Generics/Conditions/AssignableToExpectedValueAssertCondition.cs @@ -13,6 +13,6 @@ protected override Task GetResult(TActual? actualValue, Excepti .FailIf(() => actualValue is null, () => "actual is null") .OrFailIf( - () => !actualValue!.GetType().IsAssignableTo(expectedType), + () => !expectedType.IsAssignableFrom(actualValue!.GetType()), () => $"it is {ActualValue?.GetType().Name ?? "null"}"); } \ No newline at end of file diff --git a/TUnit.Assertions/Assertions/Generics/Conditions/EqualsExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Generics/Conditions/EqualsExpectedValueAssertCondition.cs index bcd19f8e5f..443896c93e 100644 --- a/TUnit.Assertions/Assertions/Generics/Conditions/EqualsExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Generics/Conditions/EqualsExpectedValueAssertCondition.cs @@ -1,4 +1,7 @@ -using TUnit.Assertions.AssertConditions; +#if !NET +#pragma warning disable CS8604 // Possible null reference argument. +#endif +using TUnit.Assertions.AssertConditions; namespace TUnit.Assertions.Assertions.Generics.Conditions; diff --git a/TUnit.Assertions/Assertions/Generics/Conditions/EquivalentToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Generics/Conditions/EquivalentToExpectedValueAssertCondition.cs index 2a9c08bca7..2aa849da33 100644 --- a/TUnit.Assertions/Assertions/Generics/Conditions/EquivalentToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Generics/Conditions/EquivalentToExpectedValueAssertCondition.cs @@ -40,7 +40,7 @@ protected override AssertionResult GetResult(TActual? actualValue, TExpected? ex { MembersToIgnore = [.._ignoredMembers] })), - () => $"it is {string.Join(',', actualEnumerable)}"); + () => $"it is {string.Join(",", actualEnumerable)}"); } bool? isEqual = null; @@ -78,7 +78,7 @@ protected override AssertionResult GetResult(TActual? actualValue, TExpected? ex } return FailWithMessage($""" - {firstFailure.Type} {string.Join('.', firstFailure.NestedMemberNames)} did not match + {firstFailure.Type} {string.Join(".", firstFailure.NestedMemberNames)} did not match Expected: {Formatter.Format(firstFailure.Expected)} Received: {Formatter.Format(firstFailure.Actual)} """); diff --git a/TUnit.Assertions/Assertions/Generics/Conditions/NotAssignableToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Generics/Conditions/NotAssignableToExpectedValueAssertCondition.cs index 3a1ed86874..dfb1cb59fd 100644 --- a/TUnit.Assertions/Assertions/Generics/Conditions/NotAssignableToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Generics/Conditions/NotAssignableToExpectedValueAssertCondition.cs @@ -13,6 +13,6 @@ protected override Task GetResult(TActual? actualValue, Excepti .FailIf(() => actualValue is null, () => "actual is null") .OrFailIf( - () => actualValue!.GetType().IsAssignableTo(expectedType), + () => expectedType.IsAssignableFrom(actualValue!.GetType()), () => $"it is {ActualValue?.GetType().Name ?? "null"}"); } \ No newline at end of file diff --git a/TUnit.Assertions/Assertions/Numbers/NumberIsExtensions.cs b/TUnit.Assertions/Assertions/Numbers/NumberIsExtensions.cs index d2118401e4..2f677952ad 100644 --- a/TUnit.Assertions/Assertions/Numbers/NumberIsExtensions.cs +++ b/TUnit.Assertions/Assertions/Numbers/NumberIsExtensions.cs @@ -1,5 +1,7 @@ #nullable disable +#if NET + using System.Numerics; using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions; @@ -134,4 +136,6 @@ public static InvokableValueAssertionBuilder IsPositive( $"to be positive") , []); } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Numbers/NumberIsNotExtensions.cs b/TUnit.Assertions/Assertions/Numbers/NumberIsNotExtensions.cs index 5280fffb50..ba24dfeb4c 100644 --- a/TUnit.Assertions/Assertions/Numbers/NumberIsNotExtensions.cs +++ b/TUnit.Assertions/Assertions/Numbers/NumberIsNotExtensions.cs @@ -1,5 +1,7 @@ #nullable disable +#if NET + using System.Numerics; using System.Runtime.CompilerServices; using TUnit.Assertions.AssertConditions; @@ -201,4 +203,6 @@ public static InvokableValueAssertionBuilder IsNotPositive(thi $"to not be positive") , []); } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Assertions/Strings/DoesExtensions_String.cs b/TUnit.Assertions/Assertions/Strings/DoesExtensions_String.cs index b6eebc1a3b..1f071a1b8b 100644 --- a/TUnit.Assertions/Assertions/Strings/DoesExtensions_String.cs +++ b/TUnit.Assertions/Assertions/Strings/DoesExtensions_String.cs @@ -59,7 +59,7 @@ public static InvokableValueAssertionBuilder EndsWith(this IValueSource< return valueSource.RegisterAssertion(new FuncValueAssertCondition(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return actual.EndsWith(expected, stringComparison); }, (actual, _, _) => $"\"{actual}\" does not end with \"{expected}\"", @@ -77,7 +77,7 @@ public static InvokableValueAssertionBuilder Matches(this IValueSource(regex, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return regex.IsMatch(actual); }, (actual, _, _) => $"The regex \"{regex}\" does not match with \"{actual}\"", diff --git a/TUnit.Assertions/Assertions/Strings/DoesNotExtensions_String.cs b/TUnit.Assertions/Assertions/Strings/DoesNotExtensions_String.cs index 74e95e7ddb..28ba392f99 100644 --- a/TUnit.Assertions/Assertions/Strings/DoesNotExtensions_String.cs +++ b/TUnit.Assertions/Assertions/Strings/DoesNotExtensions_String.cs @@ -31,7 +31,7 @@ public static InvokableValueAssertionBuilder DoesNotStartWith(this IValu return valueSource.RegisterAssertion(new FuncValueAssertCondition(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return !actual.StartsWith(expected, stringComparison); }, (actual, _, _) => $"\"{actual}\" does start with \"{expected}\"", @@ -50,7 +50,7 @@ public static InvokableValueAssertionBuilder DoesNotEndWith(this IValueS return valueSource.RegisterAssertion(new FuncValueAssertCondition(expected, (actual, _, _) => { - ArgumentNullException.ThrowIfNull(actual); + Verify.ArgNotNull(actual); return !actual.EndsWith(expected, stringComparison); }, (actual, _, _) => $"\"{actual}\" does end with \"{expected}\"", diff --git a/TUnit.Assertions/Assertions/Throws/ThrowsOfTypeAssertCondition.cs b/TUnit.Assertions/Assertions/Throws/ThrowsOfTypeAssertCondition.cs index 011a20722e..b5d99ceb3c 100644 --- a/TUnit.Assertions/Assertions/Throws/ThrowsOfTypeAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Throws/ThrowsOfTypeAssertCondition.cs @@ -13,7 +13,7 @@ protected override Task GetResult(TActual? actualValue, Excepti () => exception is null, () => "none was thrown") .OrFailIf( - () => !exception!.GetType().IsAssignableTo(typeof(TExpectedException)), + () => !typeof(TExpectedException).IsAssignableFrom(exception!.GetType()), () => $"{exception?.GetType().Name.PrependAOrAn()} was thrown" ); } \ No newline at end of file diff --git a/TUnit.Assertions/Compare.cs b/TUnit.Assertions/Compare.cs index c482c5fecb..28e2e84483 100644 --- a/TUnit.Assertions/Compare.cs +++ b/TUnit.Assertions/Compare.cs @@ -83,7 +83,7 @@ private static IEnumerable CheckEquivalent< { string?[] readOnlySpan = [..memberNames, $"[{i}]"]; - if (options.MembersToIgnore.Contains(string.Join('.', readOnlySpan))) + if (options.MembersToIgnore.Contains(string.Join(".", readOnlySpan))) { continue; } @@ -106,7 +106,7 @@ private static IEnumerable CheckEquivalent< { string?[] readOnlySpan = [..memberNames, fieldName]; - if (options.MembersToIgnore.Contains(string.Join('.', readOnlySpan))) + if (options.MembersToIgnore.Contains(string.Join(".", readOnlySpan))) { continue; } @@ -147,7 +147,7 @@ private static IEnumerable CheckEquivalent< { string?[] readOnlySpan = [..memberNames, propertyName]; - if (options.MembersToIgnore.Contains(string.Join('.', readOnlySpan))) + if (options.MembersToIgnore.Contains(string.Join(".", readOnlySpan))) { continue; } diff --git a/TUnit.Assertions/Equality/EquivalentToEqualityComparer.cs b/TUnit.Assertions/Equality/EquivalentToEqualityComparer.cs index 44f9808a7a..9175d34af5 100644 --- a/TUnit.Assertions/Equality/EquivalentToEqualityComparer.cs +++ b/TUnit.Assertions/Equality/EquivalentToEqualityComparer.cs @@ -1,4 +1,8 @@ -using System.Diagnostics.CodeAnalysis; +#if !NET +#pragma warning disable CS8767 // Nullability of type parameters in type of collection doesn't match implicitly implemented member (possibly because of nullability attributes). +#endif + +using System.Diagnostics.CodeAnalysis; namespace TUnit.Assertions.Equality; diff --git a/TUnit.Assertions/ExceptionsHelper.cs b/TUnit.Assertions/ExceptionsHelper.cs index 0e31aefd39..b3def8b13a 100644 --- a/TUnit.Assertions/ExceptionsHelper.cs +++ b/TUnit.Assertions/ExceptionsHelper.cs @@ -10,7 +10,7 @@ public static void ThrowIfAny(IReadOnlyList exceptions) { if (exceptions.Count == 1) { - ExceptionDispatchInfo.Throw(exceptions[0]); + ExceptionDispatchInfo.Capture(exceptions[0]).Throw(); } if (exceptions.Count > 1) diff --git a/TUnit.Assertions/Extensions/NumberExtensions.cs b/TUnit.Assertions/Extensions/NumberExtensions.cs index cefbb71ba9..79514260a7 100644 --- a/TUnit.Assertions/Extensions/NumberExtensions.cs +++ b/TUnit.Assertions/Extensions/NumberExtensions.cs @@ -1,4 +1,6 @@ -using System.Numerics; +#if NET + +using System.Numerics; namespace TUnit.Assertions.Extensions; @@ -9,4 +11,6 @@ public static bool IsBetween(this INumber number, INumber= 0 && number.CompareTo(max) <= 0; } -} \ No newline at end of file +} + +#endif diff --git a/TUnit.Assertions/Helpers/Formatter.cs b/TUnit.Assertions/Helpers/Formatter.cs index df0445a0c2..399c21750a 100644 --- a/TUnit.Assertions/Helpers/Formatter.cs +++ b/TUnit.Assertions/Helpers/Formatter.cs @@ -27,8 +27,10 @@ public override string FormatValue(object? value) new SimpleFormatter(value => $"'{value}'"), new SimpleFormatter(value => $"<{value:O}>"), new SimpleFormatter(value => value.ToString("", CultureInfo.InvariantCulture)), +#if NET new SimpleFormatter(value => value.ToString("", CultureInfo.InvariantCulture)), new SimpleFormatter(value => value.ToString("", CultureInfo.InvariantCulture)), +#endif new SimpleFormatter(value => $"[{string.Join(", ", value.Cast().Select(Format))}]") ]; diff --git a/TUnit.Assertions/StringUtils.cs b/TUnit.Assertions/StringUtils.cs index 0d8a5594d8..cf941f98bb 100644 --- a/TUnit.Assertions/StringUtils.cs +++ b/TUnit.Assertions/StringUtils.cs @@ -8,17 +8,17 @@ internal static class StringUtils { return null; } - - return string.Join(string.Empty, input.Where(c=>!char.IsWhiteSpace(c))); + + return string.Join(string.Empty, input.Where(c => !char.IsWhiteSpace(c))); } - - public static string FindClosestSubstring(string? text, string? pattern, + + public static string FindClosestSubstring(string? text, string? pattern, StringComparison stringComparison, bool ignoreWhitespace, - out int differIndexOnActual, + out int differIndexOnActual, out int differIndexOnExpected) { - if (string.IsNullOrEmpty(text) || string.IsNullOrEmpty(pattern)) + if (text is not { Length: > 0 } || pattern is not { Length: > 0 }) { differIndexOnActual = -1; differIndexOnExpected = -1; @@ -27,7 +27,7 @@ public static string FindClosestSubstring(string? text, string? pattern, differIndexOnExpected = 0; differIndexOnActual = 0; - + var actualDictionary = text.Select((x, i) => (Char: x, Index: i)).ToDictionary(x => x.Index, x => x.Char); var expectedDictionary = pattern.Select((x, i) => (Char: x, Index: i)).ToDictionary(x => x.Index, x => x.Char); @@ -45,12 +45,12 @@ public static string FindClosestSubstring(string? text, string? pattern, } var actualKeys = actualDictionary.Keys.ToList(); - + var matchingConsecutiveCount = 0; var c = pattern[0]; var indexes = actualDictionary.Where(tuple => tuple.Value.Equals(c)).Select(x => x.Key).ToArray(); - + foreach (var index in indexes) { var consecutiveCount = 0; @@ -65,20 +65,20 @@ public static string FindClosestSubstring(string? text, string? pattern, { break; } - + var actualChar = actualDictionary[actualKey.Value]; - + var expectedChar = expectedDictionary.Values.ElementAt(i); - + if (string.Equals(actualChar.ToString(), expectedChar.ToString(), stringComparison)) { consecutiveCount++; - + if (consecutiveCount > matchingConsecutiveCount) { differIndexOnExpected = expectedDictionary.Keys.ElementAt(i); differIndexOnActual = index + expectedDictionary.Keys.ElementAt(i) - expectedDictionary.Keys.ElementAt(0); - matchingConsecutiveCount = consecutiveCount; + matchingConsecutiveCount = consecutiveCount; } } else @@ -87,9 +87,9 @@ public static string FindClosestSubstring(string? text, string? pattern, } } } - - var startIndex = Math.Max(differIndexOnActual-25, 0); - + + var startIndex = Math.Max(differIndexOnActual - 25, 0); + return text.Substring(startIndex, Math.Min(text.Length - startIndex, 50)); } } \ No newline at end of file diff --git a/TUnit.Assertions/TUnit.Assertions.csproj b/TUnit.Assertions/TUnit.Assertions.csproj index a6c4135991..010d430966 100644 --- a/TUnit.Assertions/TUnit.Assertions.csproj +++ b/TUnit.Assertions/TUnit.Assertions.csproj @@ -1,18 +1,17 @@  + preview - - + + - - - + + + @@ -20,12 +19,17 @@ + + + + + true buildTransitive/$(TargetFramework)/ - + true buildTransitive/$(TargetFramework)/ diff --git a/TUnit.Core/AsyncEvent.cs b/TUnit.Core/AsyncEvent.cs index 0d978b77e5..a7decf1b72 100644 --- a/TUnit.Core/AsyncEvent.cs +++ b/TUnit.Core/AsyncEvent.cs @@ -5,12 +5,15 @@ namespace TUnit.Core; public class AsyncEvent { private readonly List> _invocationList; - private readonly Lock _locker; +#if NET + private readonly Lock _locker = new(); +#else + private readonly Backport.System.Threading.Lock _locker = Backport.System.Threading.LockFactory.Create(); +#endif private AsyncEvent() { _invocationList = []; - _locker = new(); } public static AsyncEvent operator +( diff --git a/TUnit.Core/Attributes/Executors/TestExecutorAttribute.cs b/TUnit.Core/Attributes/Executors/TestExecutorAttribute.cs index 1dc5116a23..16999f1185 100644 --- a/TUnit.Core/Attributes/Executors/TestExecutorAttribute.cs +++ b/TUnit.Core/Attributes/Executors/TestExecutorAttribute.cs @@ -5,9 +5,11 @@ namespace TUnit.Core.Executors; [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] public sealed class TestExecutorAttribute : TUnitAttribute, ITestRegisteredEventReceiver where T : ITestExecutor, new() { + public int Order => 0; + public ValueTask OnTestRegistered(TestRegisteredContext context) { context.SetTestExecutor(new T()); - return ValueTask.CompletedTask; + return default; } } \ No newline at end of file diff --git a/TUnit.Core/Attributes/ParallelGroupAttribute.cs b/TUnit.Core/Attributes/ParallelGroupAttribute.cs index 1861b4f56e..f617da7803 100644 --- a/TUnit.Core/Attributes/ParallelGroupAttribute.cs +++ b/TUnit.Core/Attributes/ParallelGroupAttribute.cs @@ -4,6 +4,8 @@ namespace TUnit.Core; public class ParallelGroupAttribute(string group) : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public string Group { get; } = group; public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) diff --git a/TUnit.Core/Attributes/ParallelLimiterAttribute.cs b/TUnit.Core/Attributes/ParallelLimiterAttribute.cs index caa0ac0719..f340618236 100644 --- a/TUnit.Core/Attributes/ParallelLimiterAttribute.cs +++ b/TUnit.Core/Attributes/ParallelLimiterAttribute.cs @@ -6,9 +6,11 @@ namespace TUnit.Core; public sealed class ParallelLimiterAttribute : TUnitAttribute, ITestRegisteredEventReceiver where TParallelLimit : IParallelLimit, new() { + public int Order => 0; + public ValueTask OnTestRegistered(TestRegisteredContext testRegisteredContext) { testRegisteredContext.SetParallelLimiter(new TParallelLimit()); - return ValueTask.CompletedTask; + return default; } }; \ No newline at end of file diff --git a/TUnit.Core/Attributes/TestData/ArgumentDisplayFormatterAttribute.cs b/TUnit.Core/Attributes/TestData/ArgumentDisplayFormatterAttribute.cs index 75e5a71fab..3ad11cb973 100644 --- a/TUnit.Core/Attributes/TestData/ArgumentDisplayFormatterAttribute.cs +++ b/TUnit.Core/Attributes/TestData/ArgumentDisplayFormatterAttribute.cs @@ -4,6 +4,8 @@ namespace TUnit.Core; public abstract class ArgumentDisplayFormatterAttribute : TUnitAttribute, ITestDiscoveryEventReceiver { + public virtual int Order => 0; + public abstract ArgumentDisplayFormatter Formatter { get; } public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) diff --git a/TUnit.Core/Attributes/TestData/ClassDataSources.cs b/TUnit.Core/Attributes/TestData/ClassDataSources.cs index 0c2107c772..cb77b11079 100644 --- a/TUnit.Core/Attributes/TestData/ClassDataSources.cs +++ b/TUnit.Core/Attributes/TestData/ClassDataSources.cs @@ -187,7 +187,11 @@ public async ValueTask OnTestEnd(SharedType shared, string key, T? item) { if (targetInvocationException.InnerException != null) { +#if NET ExceptionDispatchInfo.Throw(targetInvocationException.InnerException); +#else + ExceptionDispatchInfo.Capture(targetInvocationException.InnerException).Throw(); +#endif } throw; diff --git a/TUnit.Core/Attributes/TestMetadata/CategoryAttribute.cs b/TUnit.Core/Attributes/TestMetadata/CategoryAttribute.cs index ccbc3eee6f..6bb36dfaa2 100644 --- a/TUnit.Core/Attributes/TestMetadata/CategoryAttribute.cs +++ b/TUnit.Core/Attributes/TestMetadata/CategoryAttribute.cs @@ -5,6 +5,8 @@ namespace TUnit.Core; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] public class CategoryAttribute(string category) : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public string Category { get; } = category; public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) diff --git a/TUnit.Core/Attributes/TestMetadata/DisplayNameFormatterAttribute.cs b/TUnit.Core/Attributes/TestMetadata/DisplayNameFormatterAttribute.cs index 3b98a7e2d4..a73d9e0535 100644 --- a/TUnit.Core/Attributes/TestMetadata/DisplayNameFormatterAttribute.cs +++ b/TUnit.Core/Attributes/TestMetadata/DisplayNameFormatterAttribute.cs @@ -7,6 +7,8 @@ namespace TUnit.Core; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, Inherited = false)] public abstract class DisplayNameFormatterAttribute : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) { var displayName = FormatDisplayName(discoveredTestContext.TestContext); diff --git a/TUnit.Core/Attributes/TestMetadata/PropertyAttribute.cs b/TUnit.Core/Attributes/TestMetadata/PropertyAttribute.cs index d6209598a7..c4d93d2d20 100644 --- a/TUnit.Core/Attributes/TestMetadata/PropertyAttribute.cs +++ b/TUnit.Core/Attributes/TestMetadata/PropertyAttribute.cs @@ -5,6 +5,8 @@ namespace TUnit.Core; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] public class PropertyAttribute(string name, string value) : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public string Name { get; } = name; public string Value { get; } = value; diff --git a/TUnit.Core/Attributes/TestMetadata/RetryAttribute.cs b/TUnit.Core/Attributes/TestMetadata/RetryAttribute.cs index df4737be8d..8387b677b3 100644 --- a/TUnit.Core/Attributes/TestMetadata/RetryAttribute.cs +++ b/TUnit.Core/Attributes/TestMetadata/RetryAttribute.cs @@ -5,6 +5,8 @@ namespace TUnit.Core; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] public class RetryAttribute : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public int Times { get; } public RetryAttribute(int times) diff --git a/TUnit.Core/Attributes/TestMetadata/TimeoutAttribute.cs b/TUnit.Core/Attributes/TestMetadata/TimeoutAttribute.cs index f616cfbc50..bc97995791 100644 --- a/TUnit.Core/Attributes/TestMetadata/TimeoutAttribute.cs +++ b/TUnit.Core/Attributes/TestMetadata/TimeoutAttribute.cs @@ -5,6 +5,8 @@ namespace TUnit.Core; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] public class TimeoutAttribute(int timeoutInMilliseconds) : TUnitAttribute, ITestDiscoveryEventReceiver { + public int Order => 0; + public TimeSpan Timeout { get; } = TimeSpan.FromMilliseconds(timeoutInMilliseconds); public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) diff --git a/TUnit.Core/Data/GetOnlyDictionary.cs b/TUnit.Core/Data/GetOnlyDictionary.cs index f99cfcaa1c..b36d17721b 100644 --- a/TUnit.Core/Data/GetOnlyDictionary.cs +++ b/TUnit.Core/Data/GetOnlyDictionary.cs @@ -9,8 +9,12 @@ public class GetOnlyDictionary where TKey : notnull { private ConcurrentDictionary InnerDictionary { get; } = new(); +#if NET private static readonly Lock Lock = new(); - +#else + private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); +#endif + public ICollection Keys => InnerDictionary.Keys; public ICollection Values => InnerDictionary.Values; diff --git a/TUnit.Core/Extensions/TestContextExtensions.cs b/TUnit.Core/Extensions/TestContextExtensions.cs index c733a01494..0b17cc585e 100644 --- a/TUnit.Core/Extensions/TestContextExtensions.cs +++ b/TUnit.Core/Extensions/TestContextExtensions.cs @@ -5,6 +5,8 @@ namespace TUnit.Core.Extensions; public static class TestContextExtensions { + private static readonly char[] ClassTypeNameSplitter = { '.' }; + public static TestContext[] GetTests(this TestContext context, string testName) { return GetTests(context, testName, []); @@ -25,13 +27,13 @@ public static TestContext[] GetTests(this TestContext context, string testName, return tests; } - + public static string GetClassTypeName(this TestContext testContext) { var testDetails = testContext.TestDetails; var classTypeName = testDetails.ClassType.FullName? - .Split('.', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) + .Split(ClassTypeNameSplitter, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault() ?? testDetails.ClassType.Name; @@ -50,7 +52,7 @@ public static string GetTestDisplayName(this TestContext testContext) if (!string.IsNullOrWhiteSpace(testDetails.DisplayName)) { - return testDetails.DisplayName; + return testDetails.DisplayName!; } if (testDetails.TestMethodArguments.Length == 0) diff --git a/TUnit.Core/Interfaces/IEventReceiver.cs b/TUnit.Core/Interfaces/IEventReceiver.cs index 5491bf3a3b..b30a58cde4 100644 --- a/TUnit.Core/Interfaces/IEventReceiver.cs +++ b/TUnit.Core/Interfaces/IEventReceiver.cs @@ -2,5 +2,9 @@ namespace TUnit.Core.Interfaces; public interface IEventReceiver { +#if NET public int Order => 0; +#else + public int Order { get; } +#endif } \ No newline at end of file diff --git a/TUnit.Core/Interfaces/ITestStartEventReceiver.cs b/TUnit.Core/Interfaces/ITestStartEventReceiver.cs index 0481fa3a52..99a4335f63 100644 --- a/TUnit.Core/Interfaces/ITestStartEventReceiver.cs +++ b/TUnit.Core/Interfaces/ITestStartEventReceiver.cs @@ -5,8 +5,12 @@ public interface ITestStartEventReceiver : IEventReceiver ValueTask OnTestStart(BeforeTestContext beforeTestContext); void OnTestStartSynchronous(BeforeTestContext beforeTestContext) +#if NET { - // Default implementation that does nothing - Users can override if they wish - // Synchronous version supports setting AsyncLocal values + // Default implementation that does nothing - Users can override if they wish + // Synchronous version supports setting AsyncLocal values } +#else + ; +#endif } \ No newline at end of file diff --git a/TUnit.Core/Models/LazyHook.cs b/TUnit.Core/Models/LazyHook.cs index 9a3d905deb..195e128956 100644 --- a/TUnit.Core/Models/LazyHook.cs +++ b/TUnit.Core/Models/LazyHook.cs @@ -2,7 +2,11 @@ internal class LazyHook(Func func) { +#if NET private readonly Lock _lock = new(); +#else + private readonly Backport.System.Threading.Lock _lock = Backport.System.Threading.LockFactory.Create(); +#endif private Task? _value; public Task Value(T1 arg1, T2 arg2) diff --git a/TUnit.Core/RunHelpers.cs b/TUnit.Core/RunHelpers.cs index c2652f333b..7e680d817e 100644 --- a/TUnit.Core/RunHelpers.cs +++ b/TUnit.Core/RunHelpers.cs @@ -13,9 +13,9 @@ internal static async Task RunWithTimeoutAsync(Func tas var cancellationToken = cancellationTokenSource.Token; - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(); - await using var cancellationTokenRegistration = cancellationToken.Register(() => + using var cancellationTokenRegistration = cancellationToken.Register(() => { if (token.IsCancellationRequested) { @@ -40,12 +40,16 @@ await await Task.WhenAny { // Try set result if it doesn't have one so it finishes // and doesn't stay pending in background - taskCompletionSource.TrySetResult(); + taskCompletionSource.TrySetResult(false); } } [StackTraceHidden] +#if NET [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] +#else + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#endif public static void RunSafely(Action action, List exceptions) { try @@ -59,7 +63,11 @@ public static void RunSafely(Action action, List exceptions) } [StackTraceHidden] +#if NET [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] +#else + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#endif public static async Task RunSafelyAsync(Func action, List exceptions) { try @@ -73,7 +81,11 @@ public static async Task RunSafelyAsync(Func action, List excep } [StackTraceHidden] +#if NET [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] +#else + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#endif public static async Task RunValueTaskSafelyAsync(Func action, List exceptions) { try diff --git a/TUnit.Core/TUnit.Core.csproj b/TUnit.Core/TUnit.Core.csproj index c29f246206..fbaebd2ccf 100644 --- a/TUnit.Core/TUnit.Core.csproj +++ b/TUnit.Core/TUnit.Core.csproj @@ -1,9 +1,10 @@  - + + preview - + true @@ -15,14 +16,10 @@ - - all - analyzers - - \ No newline at end of file + diff --git a/TUnit.Core/TestContextEvents.cs b/TUnit.Core/TestContextEvents.cs index 83cfaeacd2..478ae67b44 100644 --- a/TUnit.Core/TestContextEvents.cs +++ b/TUnit.Core/TestContextEvents.cs @@ -13,6 +13,8 @@ public record TestContextEvents : ILastTestInTestSessionEventReceiver, ITestRetryEventReceiver { + public int Order => 0; + public EventHandler? OnDispose { get; set; } public AsyncEvent? OnTestRegistered { get; set; } public AsyncEvent? OnTestStart { get; set; } @@ -25,46 +27,50 @@ public record TestContextEvents : ValueTask ITestRegisteredEventReceiver.OnTestRegistered(TestRegisteredContext context) { - return OnTestRegistered?.InvokeAsync(this, context) ?? ValueTask.CompletedTask; + return OnTestRegistered?.InvokeAsync(this, context) ?? default; } ValueTask ITestStartEventReceiver.OnTestStart(BeforeTestContext beforeTestContext) { - return OnTestStart?.InvokeAsync(this, beforeTestContext) ?? ValueTask.CompletedTask; + return OnTestStart?.InvokeAsync(this, beforeTestContext) ?? default; } ValueTask ITestEndEventReceiver.OnTestEnd(TestContext testContext) { - return OnTestEnd?.InvokeAsync(this, testContext) ?? ValueTask.CompletedTask; + return OnTestEnd?.InvokeAsync(this, testContext) ?? default; } ValueTask ITestSkippedEventReceiver.OnTestSkipped(TestContext testContext) { - return OnTestSkipped?.InvokeAsync(this, testContext) ?? ValueTask.CompletedTask; + return OnTestSkipped?.InvokeAsync(this, testContext) ?? default; } ValueTask ILastTestInClassEventReceiver.OnLastTestInClass(ClassHookContext context, TestContext testContext) { - return OnLastTestInClass?.InvokeAsync(this, (context, testContext)) ?? ValueTask.CompletedTask; + return OnLastTestInClass?.InvokeAsync(this, (context, testContext)) ?? default; } ValueTask ILastTestInAssemblyEventReceiver.OnLastTestInAssembly(AssemblyHookContext context, TestContext testContext) { - return OnLastTestInAssembly?.InvokeAsync(this, (context, testContext)) ?? ValueTask.CompletedTask; + return OnLastTestInAssembly?.InvokeAsync(this, (context, testContext)) ?? default; } ValueTask ILastTestInTestSessionEventReceiver.OnLastTestInTestSession(TestSessionContext context, TestContext testContext) { - return OnLastTestInTestSession?.InvokeAsync(this, (context, testContext)) ?? ValueTask.CompletedTask; + return OnLastTestInTestSession?.InvokeAsync(this, (context, testContext)) ?? default; } ValueTask ITestRetryEventReceiver.OnTestRetry(TestContext testContext, int retryAttempt) { - return OnTestRetry?.InvokeAsync(this, (testContext, retryAttempt)) ?? ValueTask.CompletedTask; + return OnTestRetry?.InvokeAsync(this, (testContext, retryAttempt)) ?? default; } public void Dispose() { OnDispose?.Invoke(this, EventArgs.Empty); } + + public void OnTestStartSynchronous(BeforeTestContext beforeTestContext) + { + } } \ No newline at end of file diff --git a/TUnit.Core/TestDataContainer.cs b/TUnit.Core/TestDataContainer.cs index 382b4133b5..0509e326bc 100644 --- a/TUnit.Core/TestDataContainer.cs +++ b/TUnit.Core/TestDataContainer.cs @@ -15,7 +15,11 @@ public static class TestDataContainer private static readonly GetOnlyDictionary> InjectedSharedPerAssembly = new(); private static readonly GetOnlyDictionary> InjectedSharedPerKey = new(); +#if NET private static readonly Lock Lock = new(); +#else + private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); +#endif private static readonly ConcurrentDictionary> CountsPerKey = new(); private static readonly ConcurrentDictionary CountsPerGlobalType = new(); diff --git a/TUnit.Engine/Capabilities/BannerCapability.cs b/TUnit.Engine/Capabilities/BannerCapability.cs index c8e91789b9..1471ae4a8a 100644 --- a/TUnit.Engine/Capabilities/BannerCapability.cs +++ b/TUnit.Engine/Capabilities/BannerCapability.cs @@ -42,7 +42,11 @@ private string GetRuntimeDetails() $"TUnit v{typeof(BannerCapability).Assembly.GetName().Version!.ToString()}", GetApplicationMemorySize(), RuntimeInformation.OSDescription, +#if NET RuntimeInformation.RuntimeIdentifier, +#else + ".NET Framework", +#endif RuntimeInformation.FrameworkDescription, $"Microsoft Testing Platform v{platformInformation.Version}" ]; diff --git a/TUnit.Engine/Extensions/TestContextExtensions.cs b/TUnit.Engine/Extensions/TestContextExtensions.cs index b2dd526052..1d322644e8 100644 --- a/TUnit.Engine/Extensions/TestContextExtensions.cs +++ b/TUnit.Engine/Extensions/TestContextExtensions.cs @@ -40,7 +40,7 @@ public static async Task ReregisterTestWithArguments( } catch (TargetInvocationException e) { - ExceptionDispatchInfo.Throw(e.InnerException ?? e); + ExceptionDispatchInfo.Capture(e.InnerException ?? e).Throw(); } } ) with diff --git a/TUnit.Engine/Framework/TUnitServiceProvider.cs b/TUnit.Engine/Framework/TUnitServiceProvider.cs index ca434eaf5a..58adc97aa9 100644 --- a/TUnit.Engine/Framework/TUnitServiceProvider.cs +++ b/TUnit.Engine/Framework/TUnitServiceProvider.cs @@ -114,9 +114,14 @@ public TUnitServiceProvider(IExtension extension, public async ValueTask DisposeAsync() { +#if NET await StandardOutConsoleInterceptor.DisposeAsync(); await StandardErrorConsoleInterceptor.DisposeAsync(); - +#else + StandardOutConsoleInterceptor.Dispose(); + StandardErrorConsoleInterceptor.Dispose(); +#endif + foreach (var servicesValue in _services.Values) { await Disposer.DisposeAsync(servicesValue); @@ -132,6 +137,7 @@ private T Register(T t) public object? GetService(Type serviceType) { - return _services.GetValueOrDefault(serviceType); + _services.TryGetValue(serviceType, out object? result); + return result; } } \ No newline at end of file diff --git a/TUnit.Engine/Helpers/ExceptionsHelper.cs b/TUnit.Engine/Helpers/ExceptionsHelper.cs index 9c94be0bf0..66cc98a597 100644 --- a/TUnit.Engine/Helpers/ExceptionsHelper.cs +++ b/TUnit.Engine/Helpers/ExceptionsHelper.cs @@ -10,7 +10,7 @@ public static void ThrowIfAny(IReadOnlyList exceptions) { if (exceptions.Count == 1) { - ExceptionDispatchInfo.Throw(exceptions[0]); + ExceptionDispatchInfo.Capture(exceptions[0]).Throw(); } if (exceptions.Count > 1) diff --git a/TUnit.Engine/Hooks/AssemblyHookOrchestrator.cs b/TUnit.Engine/Hooks/AssemblyHookOrchestrator.cs index a66559cff9..075691d407 100644 --- a/TUnit.Engine/Hooks/AssemblyHookOrchestrator.cs +++ b/TUnit.Engine/Hooks/AssemblyHookOrchestrator.cs @@ -14,7 +14,7 @@ internal class AssemblyHookOrchestrator(InstanceTracker instanceTracker, HooksCo private readonly ConcurrentDictionary _beforeHooksReached = new(); - internal GetOnlyDictionary PreviouslyRunBeforeHooks { get; } = new(); + internal GetOnlyDictionary> PreviouslyRunBeforeHooks { get; } = new(); public IEnumerable> CollectBeforeHooks(Assembly assembly) { diff --git a/TUnit.Engine/Hooks/ClassHookOrchestrator.cs b/TUnit.Engine/Hooks/ClassHookOrchestrator.cs index d093da2353..604e722048 100644 --- a/TUnit.Engine/Hooks/ClassHookOrchestrator.cs +++ b/TUnit.Engine/Hooks/ClassHookOrchestrator.cs @@ -13,7 +13,7 @@ internal class ClassHookOrchestrator(InstanceTracker instanceTracker, HooksColle private readonly ConcurrentDictionary _beforeHooksReached = new(); - internal GetOnlyDictionary PreviouslyRunBeforeHooks { get; } = new(); + internal GetOnlyDictionary> PreviouslyRunBeforeHooks { get; } = new(); public IEnumerable> CollectBeforeHooks(Type testClassType) { diff --git a/TUnit.Engine/Logging/ConsoleInterceptor.cs b/TUnit.Engine/Logging/ConsoleInterceptor.cs index 9bd6cf68ec..64a8c0de81 100644 --- a/TUnit.Engine/Logging/ConsoleInterceptor.cs +++ b/TUnit.Engine/Logging/ConsoleInterceptor.cs @@ -16,12 +16,14 @@ internal abstract class ConsoleInterceptor(ICommandLineOptions commandLineOption private protected abstract void ResetDefault(); +#if NET public override ValueTask DisposeAsync() { ResetDefault(); return ValueTask.CompletedTask; } - +#endif + public override void Flush() { GetOriginalOut().Flush(); @@ -403,37 +405,37 @@ public override void Write(char[] buffer, int index, int count) RedirectedOut?.Write(buffer, index, count); } - public override void Write(ReadOnlySpan buffer) + public override void Write(string? value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - GetOriginalOut().Write(buffer); + GetOriginalOut().Write(value); } - RedirectedOut?.Write(buffer); + RedirectedOut?.Write(value); } - public override void Write(string? value) + public override async Task WriteAsync(char value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - GetOriginalOut().Write(value); + await GetOriginalOut().WriteAsync(value); } - RedirectedOut?.Write(value); + await (RedirectedOut?.WriteAsync(value) ?? Task.CompletedTask); } - public override void Write(StringBuilder? value) + public override async Task WriteAsync(char[] buffer, int index, int count) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - GetOriginalOut().Write(value); + await GetOriginalOut().WriteAsync(buffer, index, count); } - RedirectedOut?.Write(value); + await (RedirectedOut?.WriteAsync(buffer, index, count) ?? Task.CompletedTask); } - public override async Task WriteAsync(char value) + public override async Task WriteAsync(string? value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { @@ -443,34 +445,35 @@ public override async Task WriteAsync(char value) await (RedirectedOut?.WriteAsync(value) ?? Task.CompletedTask); } - public override async Task WriteAsync(char[] buffer, int index, int count) +#if NET + public override void Write(ReadOnlySpan buffer) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteAsync(buffer, index, count); + GetOriginalOut().Write(buffer); } - await (RedirectedOut?.WriteAsync(buffer, index, count) ?? Task.CompletedTask); + RedirectedOut?.Write(buffer); } - public override async Task WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = new()) + public override void Write(StringBuilder? value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteAsync(buffer, cancellationToken); + GetOriginalOut().Write(value); } - await (RedirectedOut?.WriteAsync(buffer, cancellationToken) ?? Task.CompletedTask); + RedirectedOut?.Write(value); } - public override async Task WriteAsync(string? value) + public override async Task WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = new()) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteAsync(value); + await GetOriginalOut().WriteAsync(buffer, cancellationToken); } - await (RedirectedOut?.WriteAsync(value) ?? Task.CompletedTask); + await (RedirectedOut?.WriteAsync(buffer, cancellationToken) ?? Task.CompletedTask); } public override async Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = new()) @@ -503,53 +506,54 @@ public override void WriteLine(StringBuilder? value) RedirectedOut?.WriteLine(value); } - public override async Task WriteLineAsync(char value) + public override async Task WriteLineAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = new()) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteLineAsync(value); + await GetOriginalOut().WriteLineAsync(buffer, cancellationToken); } - await (RedirectedOut?.WriteLineAsync(value) ?? Task.CompletedTask); + await (RedirectedOut?.WriteLineAsync(buffer, cancellationToken) ?? Task.CompletedTask); } - public override async Task WriteLineAsync(char[] buffer, int index, int count) + public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = new()) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteLineAsync(buffer, index, count); + await GetOriginalOut().WriteLineAsync(value, cancellationToken); } - await (RedirectedOut?.WriteLineAsync(buffer, index, count) ?? Task.CompletedTask); + await (RedirectedOut?.WriteLineAsync(value, cancellationToken) ?? Task.CompletedTask); } +#endif - public override async Task WriteLineAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = new()) + public override async Task WriteLineAsync(char value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteLineAsync(buffer, cancellationToken); + await GetOriginalOut().WriteLineAsync(value); } - await (RedirectedOut?.WriteLineAsync(buffer, cancellationToken) ?? Task.CompletedTask); + await (RedirectedOut?.WriteLineAsync(value) ?? Task.CompletedTask); } - public override async Task WriteLineAsync(string? value) + public override async Task WriteLineAsync(char[] buffer, int index, int count) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteLineAsync(value); + await GetOriginalOut().WriteLineAsync(buffer, index, count); } - await (RedirectedOut?.WriteLineAsync(value) ?? Task.CompletedTask); + await (RedirectedOut?.WriteLineAsync(buffer, index, count) ?? Task.CompletedTask); } - public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = new()) + public override async Task WriteLineAsync(string? value) { if (!commandLineOptions.IsOptionSet(HideTestOutputCommandProvider.HideTestOutput)) { - await GetOriginalOut().WriteLineAsync(value, cancellationToken); + await GetOriginalOut().WriteLineAsync(value); } - await (RedirectedOut?.WriteLineAsync(value, cancellationToken) ?? Task.CompletedTask); + await (RedirectedOut?.WriteLineAsync(value) ?? Task.CompletedTask); } } \ No newline at end of file diff --git a/TUnit.Engine/PolyfillExtensions.cs b/TUnit.Engine/PolyfillExtensions.cs new file mode 100644 index 0000000000..3800d6430e --- /dev/null +++ b/TUnit.Engine/PolyfillExtensions.cs @@ -0,0 +1,261 @@ +using System.Diagnostics.CodeAnalysis; + +namespace TUnit; + +static class PolyfillExtensions +{ + internal static void Deconstruct(this KeyValuePair pair, out K key, out V val) + { + key = pair.Key; + val = pair.Value; + } + + internal static string ReplaceLineEndings(this string value, string replacement) + { + return value.Replace("\r\n", replacement) + .Replace("\n", replacement) + .Replace("\r", replacement); + } + + internal static bool StartsWith(this string value, char ch) => value.Length > 0 && value[0] == ch; + + internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T value) + { + if (stack.Count == 0) + { + value = default; + return false; + } + + value = stack.Pop(); + return true; + } + + internal static IOrderedEnumerable Order(this IEnumerable source) => source.OrderBy(v => v); + + /// Returns the minimum value in a generic sequence according to a specified key selector function. + /// The type of the elements of . + /// The type of key to compare elements by. + /// A sequence of values to determine the minimum value of. + /// A function to extract the key for each element. + /// The value with the minimum key in the sequence. + /// is . + /// No key extracted from implements the or interface. + /// + /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . + /// + internal static TSource? MinBy(this IEnumerable source, Func keySelector) => MinBy(source, keySelector, comparer: null); + + /// Returns the minimum value in a generic sequence according to a specified key selector function. + /// The type of the elements of . + /// The type of key to compare elements by. + /// A sequence of values to determine the minimum value of. + /// A function to extract the key for each element. + /// The to compare keys. + /// The value with the minimum key in the sequence. + /// is . + /// No key extracted from implements the or interface. + /// + /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . + /// + internal static TSource? MinBy(this IEnumerable source, Func keySelector, IComparer? comparer) + { + Verify.ArgNotNull(source); + Verify.ArgNotNull(keySelector); + + comparer ??= Comparer.Default; + + using IEnumerator e = source.GetEnumerator(); + + if (!e.MoveNext()) + { + if (default(TSource) is null) + { + return default; + } + else + { + throw new InvalidOperationException("No elements."); + } + } + + TSource value = e.Current; + TKey key = keySelector(value); + + if (default(TKey) is null) + { + if (key is null) + { + TSource firstValue = value; + + do + { + if (!e.MoveNext()) + { + // All keys are null, surface the first element. + return firstValue; + } + + value = e.Current; + key = keySelector(value); + } + while (key is null); + } + + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (nextKey is not null && comparer.Compare(nextKey, key) < 0) + { + key = nextKey; + value = nextValue; + } + } + } + else + { + if (comparer == Comparer.Default) + { + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (Comparer.Default.Compare(nextKey, key) < 0) + { + key = nextKey; + value = nextValue; + } + } + } + else + { + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (comparer.Compare(nextKey, key) < 0) + { + key = nextKey; + value = nextValue; + } + } + } + } + + return value; + } + + /// Returns the maximum value in a generic sequence according to a specified key selector function. + /// The type of the elements of . + /// The type of key to compare elements by. + /// A sequence of values to determine the maximum value of. + /// A function to extract the key for each element. + /// The value with the maximum key in the sequence. + /// is . + /// No key extracted from implements the or interface. + /// + /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . + /// + internal static TSource? MaxBy(this IEnumerable source, Func keySelector) => MaxBy(source, keySelector, null); + + /// Returns the maximum value in a generic sequence according to a specified key selector function. + /// The type of the elements of . + /// The type of key to compare elements by. + /// A sequence of values to determine the maximum value of. + /// A function to extract the key for each element. + /// The to compare keys. + /// The value with the maximum key in the sequence. + /// is . + /// No key extracted from implements the or interface. + /// + /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . + /// + internal static TSource? MaxBy(this IEnumerable source, Func keySelector, IComparer? comparer) + { + Verify.ArgNotNull(source); + Verify.ArgNotNull(keySelector); + + comparer ??= Comparer.Default; + + using IEnumerator e = source.GetEnumerator(); + + if (!e.MoveNext()) + { + if (default(TSource) is null) + { + return default; + } + else + { + throw new InvalidOperationException("No elements."); + } + } + + TSource value = e.Current; + TKey key = keySelector(value); + + if (default(TKey) is null) + { + if (key is null) + { + TSource firstValue = value; + + do + { + if (!e.MoveNext()) + { + // All keys are null, surface the first element. + return firstValue; + } + + value = e.Current; + key = keySelector(value); + } + while (key is null); + } + + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (nextKey is not null && comparer.Compare(nextKey, key) > 0) + { + key = nextKey; + value = nextValue; + } + } + } + else + { + if (comparer == Comparer.Default) + { + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (Comparer.Default.Compare(nextKey, key) > 0) + { + key = nextKey; + value = nextValue; + } + } + } + else + { + while (e.MoveNext()) + { + TSource nextValue = e.Current; + TKey nextKey = keySelector(nextValue); + if (comparer.Compare(nextKey, key) > 0) + { + key = nextKey; + value = nextValue; + } + } + } + } + + return value; + } +} diff --git a/TUnit.Engine/PriorityQueue.cs b/TUnit.Engine/PriorityQueue.cs new file mode 100644 index 0000000000..efcc591e67 --- /dev/null +++ b/TUnit.Engine/PriorityQueue.cs @@ -0,0 +1,54 @@ +#if !NET + +using C5; +using System.Diagnostics.CodeAnalysis; + +namespace TUnit.Engine; + +class PriorityQueue +{ + struct Element : IComparer + { + public TElement Value; + public TPriority Priority; + + public Element(TElement value, TPriority priority) + { + Value = value; + Priority = priority; + } + public int Compare(Element x, Element y) + { + return Comparer.Default.Compare(x.Priority, y.Priority); + } + } + + private IPriorityQueue list; + + public PriorityQueue() + { + this.list = new C5.IntervalHeap(); + } + + public void Enqueue(TElement item, TPriority priority) + { + list.Add(new Element(item, priority)); + } + + public bool TryDequeue([MaybeNullWhen(false)] out TElement item, [MaybeNullWhen(false)] out TPriority priority) + { + if (list.Count > 0) + { + Element element = list.DeleteMin(); + item = element.Value; + priority = element.Priority; + return true; + } + + item = default; + priority = default; + return false; + } +} + +#endif diff --git a/TUnit.Engine/Services/Counter.cs b/TUnit.Engine/Services/Counter.cs index 14925a4315..f9000c0982 100644 --- a/TUnit.Engine/Services/Counter.cs +++ b/TUnit.Engine/Services/Counter.cs @@ -5,8 +5,12 @@ namespace TUnit.Engine.Services; [DebuggerDisplay("Count = {CurrentCount}")] public class Counter { +#if NET private readonly Lock _locker = new(); - +#else + private readonly Backport.System.Threading.Lock _locker = Backport.System.Threading.LockFactory.Create(); +#endif + private int _count; public int Increment() diff --git a/TUnit.Engine/Services/OnEndExecutor.cs b/TUnit.Engine/Services/OnEndExecutor.cs index 110de64fe0..cd41eeb80d 100644 --- a/TUnit.Engine/Services/OnEndExecutor.cs +++ b/TUnit.Engine/Services/OnEndExecutor.cs @@ -36,11 +36,12 @@ private async Task WriteJsonOutputFile(TestSessionContext? testSessionContext) { var path = Path.Combine(Environment.CurrentDirectory, GetFilename()); - await using var file = File.Create(path); + using var file = File.Create(path); var jsonOutput = GetJsonOutput(testSessionContext); await JsonSerializer.SerializeAsync(file, jsonOutput, JsonContext.Default.TestSessionJson); + await file.FlushAsync(); await logger.LogInformationAsync($"TUnit JSON output saved to: {path}"); } diff --git a/TUnit.Engine/Services/SingleTestExecutor.cs b/TUnit.Engine/Services/SingleTestExecutor.cs index f5b671ffac..57773777b4 100644 --- a/TUnit.Engine/Services/SingleTestExecutor.cs +++ b/TUnit.Engine/Services/SingleTestExecutor.cs @@ -33,7 +33,11 @@ internal class SingleTestExecutor( TestRegistrar testRegistrar) : IDataProducer { +#if NET private static readonly Lock Lock = new(); +#else + private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); +#endif public Task ExecuteTestAsync(DiscoveredTest test, ITestExecutionFilter? filter, ExecuteRequestContext context, bool isStartedAsDependencyForAnotherTest) @@ -98,7 +102,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF // But users may want to set AsyncLocal values, and so the method must be a parent/ancestor of the method that starts the test! // So actually refactoring these into other methods would mean they wouldn't be a parent/ancestor and would break async local! var assemblyHooksTaskCompletionSource = assemblyHookOrchestrator.PreviouslyRunBeforeHooks.GetOrAdd(testContext.TestDetails.ClassType.Assembly, - _ => new TaskCompletionSource(), out var assemblyHooksTaskPreviouslyExisted); + _ => new TaskCompletionSource(), out var assemblyHooksTaskPreviouslyExisted); if (assemblyHooksTaskPreviouslyExisted) { @@ -128,7 +132,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF } AssemblyHookContext.Current = null; - assemblyHooksTaskCompletionSource.SetResult(); + assemblyHooksTaskCompletionSource.SetResult(false); } catch (Exception e) { @@ -138,7 +142,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF } var classHooksTaskCompletionSource = classHookOrchestrator.PreviouslyRunBeforeHooks.GetOrAdd(testContext.TestDetails.ClassType, - _ => new TaskCompletionSource(), out var classHooksTaskPreviouslyExisted); + _ => new TaskCompletionSource(), out var classHooksTaskPreviouslyExisted); if (classHooksTaskPreviouslyExisted) { @@ -167,7 +171,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF } ClassHookContext.Current = null; - classHooksTaskCompletionSource.SetResult(); + classHooksTaskCompletionSource.SetResult(false); } catch (Exception e) { @@ -216,7 +220,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF { Status.Passed => messageBus.Passed(test.TestContext, start.GetValueOrDefault()), Status.Failed => messageBus.Failed(test.TestContext, result.Exception!, start.GetValueOrDefault()), - _ => ValueTask.CompletedTask, + _ => default, }; await task; @@ -231,7 +235,7 @@ private Task RegisterIfNotAlready(TestContext testContext) if (!testContext.IsRegistered) { return testRegistrar.RegisterInstance(testContext.InternalDiscoveredTest, - _ => ValueTask.CompletedTask); + _ => default); } return Task.CompletedTask; diff --git a/TUnit.Engine/Services/TestsExecutor.cs b/TUnit.Engine/Services/TestsExecutor.cs index 4d5191c24d..2eef8bad52 100644 --- a/TUnit.Engine/Services/TestsExecutor.cs +++ b/TUnit.Engine/Services/TestsExecutor.cs @@ -17,7 +17,7 @@ internal class TestsExecutor private readonly EngineCancellationToken _engineCancellationToken; private readonly Counter _executionCounter = new(); - private readonly TaskCompletionSource _onFinished = new(); + private readonly TaskCompletionSource _onFinished = new(); private readonly int _maximumParallelTests; @@ -37,14 +37,14 @@ public TestsExecutor(SingleTestExecutor singleTestExecutor, { if (count == 0) { - _onFinished.TrySetResult(); + _onFinished.TrySetResult(false); } }; } public async Task ExecuteAsync(GroupedTests tests, ITestExecutionFilter? filter, ExecuteRequestContext context) { - await using var _ = _engineCancellationToken.Token.Register(() => _onFinished.TrySetCanceled()); + using var _ = _engineCancellationToken.Token.Register(() => _onFinished.TrySetCanceled()); try { @@ -91,10 +91,20 @@ private async Task ProcessParallelGroups(IDictionary tests) { +#if NET while (tests.TryDequeue(out var testInformation, out _)) { await ProcessTest(testInformation, filter, context, context.CancellationToken); } +#else + await Task.Run(delegate + { + while (tests.TryDequeue(out var testInformation, out _)) + { + ProcessTest(testInformation, filter, context, context.CancellationToken); + } + }); +#endif } private async Task ProcessParallelTests(IEnumerable queue, ITestExecutionFilter? filter, @@ -107,13 +117,25 @@ private async Task ProcessCollection(IEnumerable queue, ITestExecutionFilter? filter, ExecuteRequestContext context) { +#if NET await Parallel.ForEachAsync(queue, new ParallelOptions { MaxDegreeOfParallelism = _maximumParallelTests, CancellationToken = context.CancellationToken }, (test, token) => ProcessTest(test, filter, context, token)); +#else + await Task.Run(delegate + { + Parallel.ForEach(queue, new ParallelOptions + { + MaxDegreeOfParallelism = _maximumParallelTests, + CancellationToken = context.CancellationToken + }, (test, token) => ProcessTest(test, filter, context, context.CancellationToken)); + }); +#endif } +#if NET private async ValueTask ProcessTest(DiscoveredTest test, ITestExecutionFilter? filter, ExecuteRequestContext context, CancellationToken cancellationToken) { @@ -129,6 +151,23 @@ private async ValueTask ProcessTest(DiscoveredTest test, } } } +#else + private void ProcessTest(DiscoveredTest test, + ITestExecutionFilter? filter, ExecuteRequestContext context, CancellationToken cancellationToken) + { + try + { + _singleTestExecutor.ExecuteTestAsync(test, filter, context, false); + } + catch + { + if (_commandLineOptions.IsOptionSet(FailFastCommandProvider.FailFast)) + { + _engineCancellationToken.CancellationTokenSource.Cancel(); + } + } + } +#endif private int GetParallelTestsLimit() { diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index d0e44f6b56..eb74c8ab26 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -1,4 +1,5 @@  + false false @@ -7,8 +8,9 @@ LAUNCH_DEBUGGER - + + @@ -25,4 +27,4 @@ - \ No newline at end of file + diff --git a/TUnit.Engine/Verify.cs b/TUnit.Engine/Verify.cs new file mode 100644 index 0000000000..b654439fcc --- /dev/null +++ b/TUnit.Engine/Verify.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace TUnit; + +static class Verify +{ + internal static void ArgNotNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { + if (argument is null) + { + throw new ArgumentNullException(paramName); + } + } +} diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index 3bac244619..3f979b75ab 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -6,13 +6,13 @@ true true false - true + true - + false - + true true @@ -27,7 +27,7 @@ true IL2118 - + @@ -57,4 +57,4 @@ PreserveNewest - \ No newline at end of file + diff --git a/tools/speed-comparison/TUnitTimer/TUnitTimer/TUnitTimer.csproj b/tools/speed-comparison/TUnitTimer/TUnitTimer/TUnitTimer.csproj index 651b0ad991..b2b55663fb 100644 --- a/tools/speed-comparison/TUnitTimer/TUnitTimer/TUnitTimer.csproj +++ b/tools/speed-comparison/TUnitTimer/TUnitTimer/TUnitTimer.csproj @@ -18,5 +18,5 @@ true true - - \ No newline at end of file + + From fac63e75fdcf5c4a8bb4315ebeeb8e1501905a54 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:26:34 +0000 Subject: [PATCH 02/71] .NET Framework Pipeline --- .github/actions/execute-pipeline/action.yml | 7 ++- .github/workflows/dotnet-framework.yml | 34 +++++++++++++++ Directory.Build.props | 4 +- TUnit.Engine/PolyfillExtensions.cs | 43 ++++++++++--------- .../Modules/RunEngineTestsModule.cs | 2 +- .../Modules/RunPlaywrightTestsModule.cs | 2 +- TUnit.Pipeline/Modules/RunUnitTestsModule.cs | 2 +- .../Modules/TestNugetPackageModule.cs | 2 +- .../TUnit.NugetTester.Library.csproj | 2 +- .../TUnit.NugetTester.csproj | 2 +- 10 files changed, 71 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/dotnet-framework.yml diff --git a/.github/actions/execute-pipeline/action.yml b/.github/actions/execute-pipeline/action.yml index b244a7a463..55e4893bc4 100644 --- a/.github/actions/execute-pipeline/action.yml +++ b/.github/actions/execute-pipeline/action.yml @@ -20,6 +20,10 @@ inputs: description: 'Environment' required: false default: 'Development' + netversion: + description: 'Net version' + required: false + default: 'net9.0' runs: using: "composite" @@ -33,4 +37,5 @@ runs: GITHUB_TOKEN: ${{ github.token }} DOTNET_ENVIRONMENT: ${{ inputs.environment }} NuGet__ApiKey: ${{ inputs.nuget-apikey }} - NuGet__ShouldPublish: ${{ inputs.publish-packages }} \ No newline at end of file + NuGet__ShouldPublish: ${{ inputs.publish-packages }} + NET_VERSION: ${{ inputs.netversion }} \ No newline at end of file diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml new file mode 100644 index 0000000000..b8c0f34239 --- /dev/null +++ b/.github/workflows/dotnet-framework.yml @@ -0,0 +1,34 @@ +name: .NET Framework + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + modularpipeline-netframework: + environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }} + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET 9 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - name: Setup .NET Framework + uses: microsoft/setup-msbuild@v2 + + - name: Build .NET 472 + run: dotnet build -c Release -p:TreatWarningsAsErrors=true -p:SDK_VERSION=netstandard + + - name: Run Pipeline + uses: ./.github/actions/execute-pipeline + with: + environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }} + netversion: 'net472' diff --git a/Directory.Build.props b/Directory.Build.props index b1f6a76072..171fdc54e6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,10 @@ - net8.0;net9.0 + net472;net8.0;net9.0 + netstandard2.0;net8.0;net9.0 + netstandard2.0 net8.0 net8.0;net9.0 diff --git a/TUnit.Engine/PolyfillExtensions.cs b/TUnit.Engine/PolyfillExtensions.cs index 3800d6430e..1cbd9cc090 100644 --- a/TUnit.Engine/PolyfillExtensions.cs +++ b/TUnit.Engine/PolyfillExtensions.cs @@ -2,7 +2,7 @@ namespace TUnit; -static class PolyfillExtensions +internal static class PolyfillExtensions { internal static void Deconstruct(this KeyValuePair pair, out K key, out V val) { @@ -18,6 +18,7 @@ internal static string ReplaceLineEndings(this string value, string replacement) } internal static bool StartsWith(this string value, char ch) => value.Length > 0 && value[0] == ch; + internal static bool Contains(this string value, string substring, StringComparison stringComparison) => value.IndexOf(substring, stringComparison) != -1; internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T value) { @@ -79,14 +80,14 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T } } - TSource value = e.Current; - TKey key = keySelector(value); + var value = e.Current; + var key = keySelector(value); if (default(TKey) is null) { if (key is null) { - TSource firstValue = value; + var firstValue = value; do { @@ -104,8 +105,8 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (nextKey is not null && comparer.Compare(nextKey, key) < 0) { key = nextKey; @@ -115,12 +116,12 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T } else { - if (comparer == Comparer.Default) + if (Equals(comparer, Comparer.Default)) { while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (Comparer.Default.Compare(nextKey, key) < 0) { key = nextKey; @@ -132,8 +133,8 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T { while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (comparer.Compare(nextKey, key) < 0) { key = nextKey; @@ -192,14 +193,14 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T } } - TSource value = e.Current; - TKey key = keySelector(value); + var value = e.Current; + var key = keySelector(value); if (default(TKey) is null) { if (key is null) { - TSource firstValue = value; + var firstValue = value; do { @@ -217,8 +218,8 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (nextKey is not null && comparer.Compare(nextKey, key) > 0) { key = nextKey; @@ -228,12 +229,12 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T } else { - if (comparer == Comparer.Default) + if (Equals(comparer, Comparer.Default)) { while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (Comparer.Default.Compare(nextKey, key) > 0) { key = nextKey; @@ -245,8 +246,8 @@ internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T { while (e.MoveNext()) { - TSource nextValue = e.Current; - TKey nextKey = keySelector(nextValue); + var nextValue = e.Current; + var nextKey = keySelector(nextValue); if (comparer.Compare(nextKey, key) > 0) { key = nextKey; diff --git a/TUnit.Pipeline/Modules/RunEngineTestsModule.cs b/TUnit.Pipeline/Modules/RunEngineTestsModule.cs index 0b3b406fe8..367f3ff17c 100644 --- a/TUnit.Pipeline/Modules/RunEngineTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunEngineTestsModule.cs @@ -23,7 +23,7 @@ public class RunEngineTestsModule : Module Project = project.Name, NoBuild = true, Configuration = Configuration.Release, - Framework = "net8.0", + Framework = Environment.GetEnvironmentVariable("NET_VERSION"), WorkingDirectory = project.Folder! }, cancellationToken); } diff --git a/TUnit.Pipeline/Modules/RunPlaywrightTestsModule.cs b/TUnit.Pipeline/Modules/RunPlaywrightTestsModule.cs index 40a282ed54..67c4f6883c 100644 --- a/TUnit.Pipeline/Modules/RunPlaywrightTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunPlaywrightTestsModule.cs @@ -20,7 +20,7 @@ public class RunPlaywrightTestsModule : Module { NoBuild = true, Configuration = Configuration.Release, - Framework = "net8.0" + Framework = Environment.GetEnvironmentVariable("NET_VERSION"), }, cancellationToken); } } \ No newline at end of file diff --git a/TUnit.Pipeline/Modules/RunUnitTestsModule.cs b/TUnit.Pipeline/Modules/RunUnitTestsModule.cs index 2890185364..2e173869d8 100644 --- a/TUnit.Pipeline/Modules/RunUnitTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunUnitTestsModule.cs @@ -20,7 +20,7 @@ public class RunUnitTestsModule : Module { NoBuild = true, Configuration = Configuration.Release, - Framework = "net8.0" + Framework = Environment.GetEnvironmentVariable("NET_VERSION"), }, cancellationToken); } } \ No newline at end of file diff --git a/TUnit.Pipeline/Modules/TestNugetPackageModule.cs b/TUnit.Pipeline/Modules/TestNugetPackageModule.cs index d49746050e..ae19561623 100644 --- a/TUnit.Pipeline/Modules/TestNugetPackageModule.cs +++ b/TUnit.Pipeline/Modules/TestNugetPackageModule.cs @@ -14,7 +14,7 @@ namespace TUnit.Pipeline.Modules; [DependsOn] public class TestNugetPackageModule : Module { - private readonly string[] _frameworks = ["net8.0", "net9.0"]; + private readonly string[] _frameworks = ["net8.0", "net9.0", "net472"]; protected override async Task ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken) diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj index 3ccb4c8d68..39e89c9c9c 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net472;net8.0;net9.0 enable enable diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj index 8e9618f143..893ee3ee8f 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net9.0 + net472;net8.0;net9.0 enable enable From 7aad5f03a13c67fa63c7636c26000d4414fd1b8f Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:37:51 +0000 Subject: [PATCH 03/71] Fixes --- .github/workflows/dotnet-framework.yml | 2 +- Directory.Build.props | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml index b8c0f34239..ab952176aa 100644 --- a/.github/workflows/dotnet-framework.yml +++ b/.github/workflows/dotnet-framework.yml @@ -25,7 +25,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Build .NET 472 - run: dotnet build -c Release -p:TreatWarningsAsErrors=true -p:SDK_VERSION=netstandard + run: dotnet build -c Release -p:TreatWarningsAsErrors=true - name: Run Pipeline uses: ./.github/actions/execute-pipeline diff --git a/Directory.Build.props b/Directory.Build.props index 171fdc54e6..caaca38a12 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,6 @@ net472;net8.0;net9.0 netstandard2.0;net8.0;net9.0 - netstandard2.0 net8.0 net8.0;net9.0 From e917724fcad4bafd15406f003b85d93fba1c4245 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:52:42 +0000 Subject: [PATCH 04/71] Tidy --- Directory.Build.props | 3 +- Directory.Build.targets | 65 ++++++++++--------- Polyfill.props | 19 +++++- .../TUnit.Assertions.UnitTests.csproj | 6 +- TUnit.Assertions/TUnit.Assertions.csproj | 1 + TUnit.Core/TUnit.Core.csproj | 1 + TUnit.Engine/TUnit.Engine.csproj | 1 + .../TUnit.Playwright.Tests.csproj | 1 + TUnit.Playwright/TUnit.Playwright.csproj | 4 ++ TUnit.UnitTests/TUnit.UnitTests.csproj | 2 +- .../TUnit.NugetTester.Library.csproj | 2 +- .../TUnit.NugetTester.csproj | 2 +- 12 files changed, 68 insertions(+), 39 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index caaca38a12..b1f6a76072 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,7 @@ - net472;net8.0;net9.0 - netstandard2.0;net8.0;net9.0 + net8.0;net9.0 net8.0 net8.0;net9.0 diff --git a/Directory.Build.targets b/Directory.Build.targets index fd312c626d..9bbb079648 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,34 +1,41 @@ + netstandard2.0;net8.0;net9.0 + netstandard2.0;net8.0;net9.0 - - Exe - true - true - false - true - + + Exe + true + true + false + true + + + + $(DefineConstants);ROSLYN4_7_OR_GREATER + true + + + + + + + + + + + + + - - $(DefineConstants);ROSLYN4_7_OR_GREATER - true - - - - - - - - - - - - - - - - TUnit - TUnit.Engine.Framework.TestingPlatformBuilderHook - - + + TUnit + TUnit.Engine.Framework.TestingPlatformBuilderHook + + \ No newline at end of file diff --git a/Polyfill.props b/Polyfill.props index 3897b8c91c..4ac65814ec 100644 --- a/Polyfill.props +++ b/Polyfill.props @@ -1,14 +1,27 @@ - $(TargetFrameworks);netstandard2.0 true + + + + all + analyzers + + + + + + - + - + \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj index a728a652c4..8d2a737034 100644 --- a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj +++ b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj @@ -1,6 +1,7 @@  - + + true false true preview @@ -16,7 +17,8 @@ - + \ No newline at end of file diff --git a/TUnit.Assertions/TUnit.Assertions.csproj b/TUnit.Assertions/TUnit.Assertions.csproj index 010d430966..79c17aaf99 100644 --- a/TUnit.Assertions/TUnit.Assertions.csproj +++ b/TUnit.Assertions/TUnit.Assertions.csproj @@ -2,6 +2,7 @@ + true preview diff --git a/TUnit.Core/TUnit.Core.csproj b/TUnit.Core/TUnit.Core.csproj index fbaebd2ccf..9eb3d45fd7 100644 --- a/TUnit.Core/TUnit.Core.csproj +++ b/TUnit.Core/TUnit.Core.csproj @@ -2,6 +2,7 @@ + true preview diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index eb74c8ab26..c709606eef 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -1,6 +1,7 @@  + true false false preview diff --git a/TUnit.Playwright.Tests/TUnit.Playwright.Tests.csproj b/TUnit.Playwright.Tests/TUnit.Playwright.Tests.csproj index d6d5b811ec..6e0897546d 100644 --- a/TUnit.Playwright.Tests/TUnit.Playwright.Tests.csproj +++ b/TUnit.Playwright.Tests/TUnit.Playwright.Tests.csproj @@ -1,6 +1,7 @@  + true false true Exe diff --git a/TUnit.Playwright/TUnit.Playwright.csproj b/TUnit.Playwright/TUnit.Playwright.csproj index 22e607a9df..d9a0f66923 100644 --- a/TUnit.Playwright/TUnit.Playwright.csproj +++ b/TUnit.Playwright/TUnit.Playwright.csproj @@ -1,5 +1,9 @@  + + true + + diff --git a/TUnit.UnitTests/TUnit.UnitTests.csproj b/TUnit.UnitTests/TUnit.UnitTests.csproj index 8501be2464..31567bb635 100644 --- a/TUnit.UnitTests/TUnit.UnitTests.csproj +++ b/TUnit.UnitTests/TUnit.UnitTests.csproj @@ -1,7 +1,7 @@ - net8.0 + true enable enable diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj index 39e89c9c9c..b81e362ab7 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + true enable enable diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj index 893ee3ee8f..5de9af9964 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj @@ -2,7 +2,7 @@ Exe - net472;net8.0;net9.0 + true enable enable From f1a7131311d1d18f5c0b6bd35c155a345d8cf145 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:02:00 +0000 Subject: [PATCH 05/71] Tidy backport locks --- TUnit.Core/AsyncEvent.cs | 6 +----- TUnit.Core/Data/GetOnlyDictionary.cs | 6 +----- TUnit.Core/Models/LazyHook.cs | 7 ++----- TUnit.Core/TestDataContainer.cs | 6 +----- TUnit.Engine/Services/Counter.cs | 6 +----- TUnit.Engine/Services/SingleTestExecutor.cs | 6 +----- 6 files changed, 7 insertions(+), 30 deletions(-) diff --git a/TUnit.Core/AsyncEvent.cs b/TUnit.Core/AsyncEvent.cs index a7decf1b72..6c009e6d9c 100644 --- a/TUnit.Core/AsyncEvent.cs +++ b/TUnit.Core/AsyncEvent.cs @@ -5,11 +5,7 @@ namespace TUnit.Core; public class AsyncEvent { private readonly List> _invocationList; -#if NET - private readonly Lock _locker = new(); -#else - private readonly Backport.System.Threading.Lock _locker = Backport.System.Threading.LockFactory.Create(); -#endif + private readonly Lock _locker = LockFactory.Create(); private AsyncEvent() { diff --git a/TUnit.Core/Data/GetOnlyDictionary.cs b/TUnit.Core/Data/GetOnlyDictionary.cs index b36d17721b..5541ac76e0 100644 --- a/TUnit.Core/Data/GetOnlyDictionary.cs +++ b/TUnit.Core/Data/GetOnlyDictionary.cs @@ -9,11 +9,7 @@ public class GetOnlyDictionary where TKey : notnull { private ConcurrentDictionary InnerDictionary { get; } = new(); -#if NET - private static readonly Lock Lock = new(); -#else - private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); -#endif + private static readonly Lock Lock = LockFactory.Create(); public ICollection Keys => InnerDictionary.Keys; public ICollection Values => InnerDictionary.Values; diff --git a/TUnit.Core/Models/LazyHook.cs b/TUnit.Core/Models/LazyHook.cs index 195e128956..ea7344ea91 100644 --- a/TUnit.Core/Models/LazyHook.cs +++ b/TUnit.Core/Models/LazyHook.cs @@ -2,11 +2,8 @@ internal class LazyHook(Func func) { -#if NET - private readonly Lock _lock = new(); -#else - private readonly Backport.System.Threading.Lock _lock = Backport.System.Threading.LockFactory.Create(); -#endif + private readonly Lock _lock = LockFactory.Create(); + private Task? _value; public Task Value(T1 arg1, T2 arg2) diff --git a/TUnit.Core/TestDataContainer.cs b/TUnit.Core/TestDataContainer.cs index 0509e326bc..8972b58177 100644 --- a/TUnit.Core/TestDataContainer.cs +++ b/TUnit.Core/TestDataContainer.cs @@ -15,11 +15,7 @@ public static class TestDataContainer private static readonly GetOnlyDictionary> InjectedSharedPerAssembly = new(); private static readonly GetOnlyDictionary> InjectedSharedPerKey = new(); -#if NET - private static readonly Lock Lock = new(); -#else - private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); -#endif + private static readonly Lock Lock = LockFactory.Create(); private static readonly ConcurrentDictionary> CountsPerKey = new(); private static readonly ConcurrentDictionary CountsPerGlobalType = new(); diff --git a/TUnit.Engine/Services/Counter.cs b/TUnit.Engine/Services/Counter.cs index f9000c0982..b19cfcc00b 100644 --- a/TUnit.Engine/Services/Counter.cs +++ b/TUnit.Engine/Services/Counter.cs @@ -5,11 +5,7 @@ namespace TUnit.Engine.Services; [DebuggerDisplay("Count = {CurrentCount}")] public class Counter { -#if NET - private readonly Lock _locker = new(); -#else - private readonly Backport.System.Threading.Lock _locker = Backport.System.Threading.LockFactory.Create(); -#endif + private readonly Lock _locker = LockFactory.Create(); private int _count; diff --git a/TUnit.Engine/Services/SingleTestExecutor.cs b/TUnit.Engine/Services/SingleTestExecutor.cs index 57773777b4..31f99eb59f 100644 --- a/TUnit.Engine/Services/SingleTestExecutor.cs +++ b/TUnit.Engine/Services/SingleTestExecutor.cs @@ -33,11 +33,7 @@ internal class SingleTestExecutor( TestRegistrar testRegistrar) : IDataProducer { -#if NET - private static readonly Lock Lock = new(); -#else - private static readonly Backport.System.Threading.Lock Lock = Backport.System.Threading.LockFactory.Create(); -#endif + private static readonly Lock Lock = LockFactory.Create(); public Task ExecuteTestAsync(DiscoveredTest test, ITestExecutionFilter? filter, ExecuteRequestContext context, bool isStartedAsDependencyForAnotherTest) From 18759f35a3a2e79709d83562ea0d2f0a06abc357 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:10:55 +0000 Subject: [PATCH 06/71] Fix --- Directory.Build.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 9bbb079648..1a7aa497bb 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,7 @@ - netstandard2.0;net8.0;net9.0 - netstandard2.0;net8.0;net9.0 + netstandard2.0;net8.0;net9.0 + netstandard2.0;net8.0;net9.0 Exe From c1e2ebca0ef6df754adb0185e197795e3f031f54 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:11:23 +0000 Subject: [PATCH 07/71] Fix --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 1a7aa497bb..c766640788 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,7 @@ netstandard2.0;net8.0;net9.0 - netstandard2.0;net8.0;net9.0 + net472;net8.0;net9.0 Exe From e244c5022c9334ccd73815f0d37ee06fa769b3f7 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:22:28 +0000 Subject: [PATCH 08/71] IsLibraryPackage --- TUnit/TUnit.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/TUnit/TUnit.csproj b/TUnit/TUnit.csproj index 8f9931b7a4..767fcec01a 100644 --- a/TUnit/TUnit.csproj +++ b/TUnit/TUnit.csproj @@ -1,6 +1,7 @@  + true false false From c16ce156fc98ae22350442e052d9110206640d4b Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:23:19 +0000 Subject: [PATCH 09/71] Backport lock fix --- Directory.Packages.props | 2 +- Polyfill.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8eb476370a..57ca638081 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ - + diff --git a/Polyfill.props b/Polyfill.props index 4ac65814ec..6c0a5d764b 100644 --- a/Polyfill.props +++ b/Polyfill.props @@ -4,7 +4,7 @@ - + all analyzers From cfcbcc2064a64bf1241fd1cc2d33e4138199c575 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:29:25 +0000 Subject: [PATCH 10/71] Fix --- TUnit.Engine/TUnit.Engine.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index c709606eef..89abdb26d5 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -1,5 +1,4 @@  - true false From eaf42b818263ca511e53f1a97eb7bb8161cd019f Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:20:47 +0000 Subject: [PATCH 11/71] Compilation fixes --- Directory.Packages.props | 3 +- Polyfill.props | 19 +- .../TUnit.Analyzers.Roslyn44.csproj | 2 +- .../TUnit.Analyzers.Roslyn47.csproj | 2 +- TUnit.Analyzers/TUnit.Analyzers.csproj | 2 +- TUnit.Assertions.UnitTests/AsyncTaskTests.cs | 8 +- .../DateOnlyEqualToAssertionTests.cs | 6 +- .../DecimalEqualsToAssertionTests.cs | 2 + .../DoubleEqualsToAssertionTests.cs | 4 +- .../IntegerEqualsToAssertionTests.cs | 2 + .../LongEqualsToAssertionTests.cs | 2 + .../TUnit.Assertions.UnitTests.csproj | 6 + .../TimeOnlyEqualToAssertionTests.cs | 6 +- .../Groups/AndAssertionGroup.cs | 4 +- .../Groups/OrAssertionGroup.cs | 4 +- ...quivalentToExpectedValueAssertCondition.cs | 4 +- .../Extensions/StringExtensions.cs | 4 +- TUnit.Assertions/TUnit.Assertions.csproj | 4 + ...TUnit.Core.SourceGenerator.Roslyn44.csproj | 2 +- ...TUnit.Core.SourceGenerator.Roslyn47.csproj | 2 +- .../CodeGenerators/PolyfillGenerator.cs | 82 ++++++ .../TUnit.Core.SourceGenerator.csproj | 2 +- TUnit.Core/AsyncEvent.cs | 2 +- TUnit.Core/Data/GetOnlyDictionary.cs | 2 +- TUnit.Core/Models/LazyHook.cs | 2 +- TUnit.Core/TUnit.Core.csproj | 3 + TUnit.Core/TestDataContainer.cs | 2 +- .../Extensions/TestContextExtensions.cs | 1 + TUnit.Engine/PolyfillExtensions.cs | 253 +----------------- TUnit.Engine/Services/Counter.cs | 2 +- TUnit.Engine/Services/SingleTestExecutor.cs | 2 +- TUnit.Engine/Services/TestsExecutor.cs | 1 + TUnit.Engine/TUnit.Engine.csproj | 3 +- TUnit.Engine/TUnitMessageBus.cs | 1 + TUnit.Playwright/WorkerAwareTest.cs | 4 +- 35 files changed, 148 insertions(+), 302 deletions(-) create mode 100644 TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 57ca638081..4822c092a6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,6 @@ - @@ -45,7 +44,7 @@ - + diff --git a/Polyfill.props b/Polyfill.props index 6c0a5d764b..4600be3045 100644 --- a/Polyfill.props +++ b/Polyfill.props @@ -1,23 +1,6 @@ - - true - - - - - all - analyzers - - - - - - - + diff --git a/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj b/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj index 9144c8cb39..4bda774b85 100644 --- a/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj +++ b/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj b/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj index da216614d8..26e6cc0f3e 100644 --- a/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj +++ b/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Analyzers/TUnit.Analyzers.csproj b/TUnit.Analyzers/TUnit.Analyzers.csproj index 0d601af7ea..7dff531419 100644 --- a/TUnit.Analyzers/TUnit.Analyzers.csproj +++ b/TUnit.Analyzers/TUnit.Analyzers.csproj @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Assertions.UnitTests/AsyncTaskTests.cs b/TUnit.Assertions.UnitTests/AsyncTaskTests.cs index bb76621112..7debde4644 100644 --- a/TUnit.Assertions.UnitTests/AsyncTaskTests.cs +++ b/TUnit.Assertions.UnitTests/AsyncTaskTests.cs @@ -22,13 +22,13 @@ public async Task Func_Awaited_Task_Is_Callable() [Test] public async Task Func_Awaited_ValueTask_Is_Callable() { - await TUnitAssert.That(async () => await ValueTask.FromResult("Hello")).IsNotNullOrEmpty().And.IsEqualTo("Hello"); + await TUnitAssert.That(async () => await new ValueTask(Task.FromResult("Hello"))).IsNotNullOrEmpty().And.IsEqualTo("Hello"); } [Test] public async Task ValueTask_Is_Callable() { - await TUnitAssert.That(ValueTask.FromResult("Hello")).IsNotNullOrEmpty().And.IsEqualTo("Hello"); + await TUnitAssert.That(new ValueTask(Task.FromResult("Hello"))).IsNotNullOrEmpty().And.IsEqualTo("Hello"); } [Test] @@ -52,7 +52,7 @@ public async Task Func_Throws_Awaited_Task_Is_Callable() [Test] public async Task Func_Throws_Awaited_ValueTask_Is_Callable() { - await TUnitAssert.ThrowsAsync(async () => await ValueTask.FromException(new DivideByZeroException())); + await TUnitAssert.ThrowsAsync(async () => await new ValueTask(Task.FromException(new DivideByZeroException()))); } [Test] @@ -64,6 +64,6 @@ public async Task Throws_Task_Is_Callable() [Test] public async Task Throws_ValueTask_Is_Callable() { - await TUnitAssert.ThrowsAsync(ValueTask.FromException(new DivideByZeroException())); + await TUnitAssert.ThrowsAsync(new ValueTask(Task.FromException(new DivideByZeroException()))); } } \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/DateOnlyEqualToAssertionTests.cs b/TUnit.Assertions.UnitTests/DateOnlyEqualToAssertionTests.cs index 535d269907..bea9da6934 100644 --- a/TUnit.Assertions.UnitTests/DateOnlyEqualToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/DateOnlyEqualToAssertionTests.cs @@ -1,4 +1,5 @@ -using TUnit.Assertions.Extensions; +#if NET +using TUnit.Assertions.Extensions; namespace TUnit.Assertions.UnitTests; @@ -41,4 +42,5 @@ public void EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2).WithinDays(1)); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/DecimalEqualsToAssertionTests.cs b/TUnit.Assertions.UnitTests/DecimalEqualsToAssertionTests.cs index 4b4529ae6a..bbfd79ca1b 100644 --- a/TUnit.Assertions.UnitTests/DecimalEqualsToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/DecimalEqualsToAssertionTests.cs @@ -22,6 +22,7 @@ public void Decimal_EqualsTo_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(double1).IsEqualTo(double2)); } +#if NET [Test] public async Task Decimal_EqualsTo__With_Tolerance_Success() { @@ -39,4 +40,5 @@ public void Decimal_EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.0001)); } +#endif } \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/DoubleEqualsToAssertionTests.cs b/TUnit.Assertions.UnitTests/DoubleEqualsToAssertionTests.cs index 753b32a7ec..f352cb0529 100644 --- a/TUnit.Assertions.UnitTests/DoubleEqualsToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/DoubleEqualsToAssertionTests.cs @@ -22,6 +22,7 @@ public void Double_EqualsTo_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(double1).IsEqualTo(double2)); } +#if NET [Test] public async Task Double_EqualsTo__With_Tolerance_Success() { @@ -30,7 +31,7 @@ public async Task Double_EqualsTo__With_Tolerance_Success() await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.1); } - + [Test] public void Double_EqualsTo__With_Tolerance_Failure() { @@ -39,4 +40,5 @@ public void Double_EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.1)); } +#endif } \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/IntegerEqualsToAssertionTests.cs b/TUnit.Assertions.UnitTests/IntegerEqualsToAssertionTests.cs index 11ce40e177..bd1e27e4b6 100644 --- a/TUnit.Assertions.UnitTests/IntegerEqualsToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/IntegerEqualsToAssertionTests.cs @@ -22,6 +22,7 @@ public void Integer_EqualsTo_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2)); } +#if NET [Test] public async Task Integer_EqualsTo__With_Tolerance_Success() { @@ -39,4 +40,5 @@ public void Integer_EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2).Within(1)); } +#endif } \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/LongEqualsToAssertionTests.cs b/TUnit.Assertions.UnitTests/LongEqualsToAssertionTests.cs index 9abd92754b..b96cb7ec5d 100644 --- a/TUnit.Assertions.UnitTests/LongEqualsToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/LongEqualsToAssertionTests.cs @@ -22,6 +22,7 @@ public void Long_EqualsTo_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2)); } +#if NET [Test] public async Task Long_EqualsTo__With_Tolerance_Success() { @@ -39,4 +40,5 @@ public void Long_EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2).Within(1)); } +#endif } \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj index 8d2a737034..cb298bcd16 100644 --- a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj +++ b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj @@ -1,4 +1,5 @@  + true @@ -21,4 +22,9 @@ OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> + + + PolyfillExtensions.cs + + \ No newline at end of file diff --git a/TUnit.Assertions.UnitTests/TimeOnlyEqualToAssertionTests.cs b/TUnit.Assertions.UnitTests/TimeOnlyEqualToAssertionTests.cs index 7ca1ab09fb..53bee93c68 100644 --- a/TUnit.Assertions.UnitTests/TimeOnlyEqualToAssertionTests.cs +++ b/TUnit.Assertions.UnitTests/TimeOnlyEqualToAssertionTests.cs @@ -1,4 +1,5 @@ -using TUnit.Assertions.Extensions; +#if NET +using TUnit.Assertions.Extensions; namespace TUnit.Assertions.UnitTests; @@ -41,4 +42,5 @@ public void EqualsTo__With_Tolerance_Failure() NUnitAssert.ThrowsAsync(async () => await TUnitAssert.That(value1).IsEqualTo(value2).Within(TimeSpan.FromSeconds(0.1))); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/TUnit.Assertions/AssertionBuilders/Groups/AndAssertionGroup.cs b/TUnit.Assertions/AssertionBuilders/Groups/AndAssertionGroup.cs index b15cc06949..36daf3b69c 100644 --- a/TUnit.Assertions/AssertionBuilders/Groups/AndAssertionGroup.cs +++ b/TUnit.Assertions/AssertionBuilders/Groups/AndAssertionGroup.cs @@ -43,11 +43,11 @@ private void Push(TAssertionBuilder assertionBuilder, Func invokableAssertionBuilder; - if (_assertConditions.TryPop(out var assertCondition)) + if (_assertConditions.Count > 0) { invokableAssertionBuilder = assert(assertionBuilder); var assertion2 = invokableAssertionBuilder.Assertions.Pop(); - _assertConditions.Push(new AndAssertCondition(assertCondition, assertion2)); + _assertConditions.Push(new AndAssertCondition(_assertConditions.Pop(), assertion2)); } else { diff --git a/TUnit.Assertions/AssertionBuilders/Groups/OrAssertionGroup.cs b/TUnit.Assertions/AssertionBuilders/Groups/OrAssertionGroup.cs index 1f4187a690..fd73cf5975 100644 --- a/TUnit.Assertions/AssertionBuilders/Groups/OrAssertionGroup.cs +++ b/TUnit.Assertions/AssertionBuilders/Groups/OrAssertionGroup.cs @@ -41,9 +41,9 @@ public OrAssertionGroup Or(Func> assert) { - if (_assertConditions.TryPop(out var assertCondition)) + if (_assertConditions.Count > 0) { - _assertConditions.Push(new OrAssertCondition(assertCondition, assert(assertionBuilder).Assertions.Pop())); + _assertConditions.Push(new OrAssertCondition(_assertConditions.Pop(), assert(assertionBuilder).Assertions.Pop())); } else { diff --git a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs index 1e4660e10f..3c8d612f92 100644 --- a/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs +++ b/TUnit.Assertions/Assertions/Collections/Conditions/EnumerableEquivalentToExpectedValueAssertCondition.cs @@ -21,8 +21,8 @@ protected override AssertionResult GetResult(TActual? actualValue, IEnumerable? orderedActual; if (collectionOrdering == CollectionOrdering.Any) { - orderedActual = actualValue?.Order(); - expectedValue = expectedValue?.Order(); + orderedActual = actualValue?.OrderBy(x => x); + expectedValue = expectedValue?.OrderBy(x => x); } else { diff --git a/TUnit.Assertions/Extensions/StringExtensions.cs b/TUnit.Assertions/Extensions/StringExtensions.cs index 10034a212b..139a7c033e 100644 --- a/TUnit.Assertions/Extensions/StringExtensions.cs +++ b/TUnit.Assertions/Extensions/StringExtensions.cs @@ -14,7 +14,9 @@ public static string GetStringOr(this string? value, string defaultValue) public static string ReplaceNewLines(this string value) { - return value.ReplaceLineEndings(" "); + return value.Replace("\r\n", " ") + .Replace("\n", " ") + .Replace("\r", " "); } public static string ShowNewLines(this string value) diff --git a/TUnit.Assertions/TUnit.Assertions.csproj b/TUnit.Assertions/TUnit.Assertions.csproj index 79c17aaf99..f0e2d0de51 100644 --- a/TUnit.Assertions/TUnit.Assertions.csproj +++ b/TUnit.Assertions/TUnit.Assertions.csproj @@ -37,4 +37,8 @@ + + + + diff --git a/TUnit.Core.SourceGenerator.Roslyn44/TUnit.Core.SourceGenerator.Roslyn44.csproj b/TUnit.Core.SourceGenerator.Roslyn44/TUnit.Core.SourceGenerator.Roslyn44.csproj index 2770736ff2..cbbcc5cd84 100644 --- a/TUnit.Core.SourceGenerator.Roslyn44/TUnit.Core.SourceGenerator.Roslyn44.csproj +++ b/TUnit.Core.SourceGenerator.Roslyn44/TUnit.Core.SourceGenerator.Roslyn44.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Core.SourceGenerator.Roslyn47/TUnit.Core.SourceGenerator.Roslyn47.csproj b/TUnit.Core.SourceGenerator.Roslyn47/TUnit.Core.SourceGenerator.Roslyn47.csproj index 13ee9701b6..1593488f04 100644 --- a/TUnit.Core.SourceGenerator.Roslyn47/TUnit.Core.SourceGenerator.Roslyn47.csproj +++ b/TUnit.Core.SourceGenerator.Roslyn47/TUnit.Core.SourceGenerator.Roslyn47.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs new file mode 100644 index 0000000000..1b2de7c6f7 --- /dev/null +++ b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs @@ -0,0 +1,82 @@ +using Microsoft.CodeAnalysis; + +namespace TUnit.Core.SourceGenerator.CodeGenerators; + +[Generator] +public class PolyfillGenerator : IIncrementalGenerator +{ + private class PreventCompilationTriggerOnEveryKeystrokeComparer : IEqualityComparer + { + public bool Equals(Compilation? x, Compilation? y) + { + if (ReferenceEquals(x, y)) + { + return true; + } + + if (x is null) + { + return false; + } + + if (y is null) + { + return false; + } + + if (x.GetType() != y.GetType()) + { + return false; + } + + return x.Language == y.Language && x.AssemblyName == y.AssemblyName; + } + + public int GetHashCode(Compilation obj) + { + unchecked + { + return (obj.Language.GetHashCode() * 397) ^ (obj.AssemblyName != null ? obj.AssemblyName.GetHashCode() : 0); + } + } + } + public void Initialize(IncrementalGeneratorInitializationContext context) + { + context.RegisterSourceOutput(context.CompilationProvider + .WithComparer(new PreventCompilationTriggerOnEveryKeystrokeComparer()), (productionContext, compilation) => + { + if (compilation.SupportsRuntimeCapability(RuntimeCapability.DefaultImplementationsOfInterfaces)) + { + return; + } + + productionContext.AddSource("ModuleInitializerAttribute.g.cs", + """ + namespace System.Runtime.CompilerServices; + + using System; + using System.Diagnostics; + using System.Diagnostics.CodeAnalysis; + + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + sealed class ModuleInitializerAttribute : Attribute; + """); + + productionContext.AddSource("StackTraceHiddenAttribute.g.cs", + """ + namespace System.Diagnostics; + + using System; + using System.Diagnostics.CodeAnalysis; + + [AttributeUsage( + AttributeTargets.Class | + AttributeTargets.Method | + AttributeTargets.Constructor | + AttributeTargets.Struct, + Inherited = false)] + sealed class StackTraceHiddenAttribute : Attribute; + """); + }); + } +} \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.csproj b/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.csproj index 61a3603f18..dcfecf82fe 100644 --- a/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.csproj +++ b/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Core/AsyncEvent.cs b/TUnit.Core/AsyncEvent.cs index 6c009e6d9c..b00da2e6bf 100644 --- a/TUnit.Core/AsyncEvent.cs +++ b/TUnit.Core/AsyncEvent.cs @@ -5,7 +5,7 @@ namespace TUnit.Core; public class AsyncEvent { private readonly List> _invocationList; - private readonly Lock _locker = LockFactory.Create(); + private readonly Lock _locker = new(); private AsyncEvent() { diff --git a/TUnit.Core/Data/GetOnlyDictionary.cs b/TUnit.Core/Data/GetOnlyDictionary.cs index 5541ac76e0..fb2d4d61d5 100644 --- a/TUnit.Core/Data/GetOnlyDictionary.cs +++ b/TUnit.Core/Data/GetOnlyDictionary.cs @@ -9,7 +9,7 @@ public class GetOnlyDictionary where TKey : notnull { private ConcurrentDictionary InnerDictionary { get; } = new(); - private static readonly Lock Lock = LockFactory.Create(); + private static readonly Lock Lock = new(); public ICollection Keys => InnerDictionary.Keys; public ICollection Values => InnerDictionary.Values; diff --git a/TUnit.Core/Models/LazyHook.cs b/TUnit.Core/Models/LazyHook.cs index ea7344ea91..76cf4808bc 100644 --- a/TUnit.Core/Models/LazyHook.cs +++ b/TUnit.Core/Models/LazyHook.cs @@ -2,7 +2,7 @@ internal class LazyHook(Func func) { - private readonly Lock _lock = LockFactory.Create(); + private readonly Lock _lock = new(); private Task? _value; diff --git a/TUnit.Core/TUnit.Core.csproj b/TUnit.Core/TUnit.Core.csproj index 9eb3d45fd7..abd88d3ea8 100644 --- a/TUnit.Core/TUnit.Core.csproj +++ b/TUnit.Core/TUnit.Core.csproj @@ -23,4 +23,7 @@ + + + diff --git a/TUnit.Core/TestDataContainer.cs b/TUnit.Core/TestDataContainer.cs index 8972b58177..382b4133b5 100644 --- a/TUnit.Core/TestDataContainer.cs +++ b/TUnit.Core/TestDataContainer.cs @@ -15,7 +15,7 @@ public static class TestDataContainer private static readonly GetOnlyDictionary> InjectedSharedPerAssembly = new(); private static readonly GetOnlyDictionary> InjectedSharedPerKey = new(); - private static readonly Lock Lock = LockFactory.Create(); + private static readonly Lock Lock = new(); private static readonly ConcurrentDictionary> CountsPerKey = new(); private static readonly ConcurrentDictionary CountsPerGlobalType = new(); diff --git a/TUnit.Engine/Extensions/TestContextExtensions.cs b/TUnit.Engine/Extensions/TestContextExtensions.cs index 1d322644e8..76eb6c1e0c 100644 --- a/TUnit.Engine/Extensions/TestContextExtensions.cs +++ b/TUnit.Engine/Extensions/TestContextExtensions.cs @@ -2,6 +2,7 @@ using System.Reflection; using System.Runtime.ExceptionServices; using Microsoft.Testing.Platform.Extensions.TestFramework; +using Polyfills; using TUnit.Core; using TUnit.Core.Enums; using TUnit.Core.Exceptions; diff --git a/TUnit.Engine/PolyfillExtensions.cs b/TUnit.Engine/PolyfillExtensions.cs index 1cbd9cc090..43b0449301 100644 --- a/TUnit.Engine/PolyfillExtensions.cs +++ b/TUnit.Engine/PolyfillExtensions.cs @@ -1,262 +1,11 @@ -using System.Diagnostics.CodeAnalysis; - -namespace TUnit; +namespace TUnit.Assertions.UnitTests; internal static class PolyfillExtensions { - internal static void Deconstruct(this KeyValuePair pair, out K key, out V val) - { - key = pair.Key; - val = pair.Value; - } - internal static string ReplaceLineEndings(this string value, string replacement) { return value.Replace("\r\n", replacement) .Replace("\n", replacement) .Replace("\r", replacement); } - - internal static bool StartsWith(this string value, char ch) => value.Length > 0 && value[0] == ch; - internal static bool Contains(this string value, string substring, StringComparison stringComparison) => value.IndexOf(substring, stringComparison) != -1; - - internal static bool TryPop(this Stack stack, [MaybeNullWhen(false)] out T value) - { - if (stack.Count == 0) - { - value = default; - return false; - } - - value = stack.Pop(); - return true; - } - - internal static IOrderedEnumerable Order(this IEnumerable source) => source.OrderBy(v => v); - - /// Returns the minimum value in a generic sequence according to a specified key selector function. - /// The type of the elements of . - /// The type of key to compare elements by. - /// A sequence of values to determine the minimum value of. - /// A function to extract the key for each element. - /// The value with the minimum key in the sequence. - /// is . - /// No key extracted from implements the or interface. - /// - /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . - /// - internal static TSource? MinBy(this IEnumerable source, Func keySelector) => MinBy(source, keySelector, comparer: null); - - /// Returns the minimum value in a generic sequence according to a specified key selector function. - /// The type of the elements of . - /// The type of key to compare elements by. - /// A sequence of values to determine the minimum value of. - /// A function to extract the key for each element. - /// The to compare keys. - /// The value with the minimum key in the sequence. - /// is . - /// No key extracted from implements the or interface. - /// - /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . - /// - internal static TSource? MinBy(this IEnumerable source, Func keySelector, IComparer? comparer) - { - Verify.ArgNotNull(source); - Verify.ArgNotNull(keySelector); - - comparer ??= Comparer.Default; - - using IEnumerator e = source.GetEnumerator(); - - if (!e.MoveNext()) - { - if (default(TSource) is null) - { - return default; - } - else - { - throw new InvalidOperationException("No elements."); - } - } - - var value = e.Current; - var key = keySelector(value); - - if (default(TKey) is null) - { - if (key is null) - { - var firstValue = value; - - do - { - if (!e.MoveNext()) - { - // All keys are null, surface the first element. - return firstValue; - } - - value = e.Current; - key = keySelector(value); - } - while (key is null); - } - - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (nextKey is not null && comparer.Compare(nextKey, key) < 0) - { - key = nextKey; - value = nextValue; - } - } - } - else - { - if (Equals(comparer, Comparer.Default)) - { - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (Comparer.Default.Compare(nextKey, key) < 0) - { - key = nextKey; - value = nextValue; - } - } - } - else - { - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (comparer.Compare(nextKey, key) < 0) - { - key = nextKey; - value = nextValue; - } - } - } - } - - return value; - } - - /// Returns the maximum value in a generic sequence according to a specified key selector function. - /// The type of the elements of . - /// The type of key to compare elements by. - /// A sequence of values to determine the maximum value of. - /// A function to extract the key for each element. - /// The value with the maximum key in the sequence. - /// is . - /// No key extracted from implements the or interface. - /// - /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . - /// - internal static TSource? MaxBy(this IEnumerable source, Func keySelector) => MaxBy(source, keySelector, null); - - /// Returns the maximum value in a generic sequence according to a specified key selector function. - /// The type of the elements of . - /// The type of key to compare elements by. - /// A sequence of values to determine the maximum value of. - /// A function to extract the key for each element. - /// The to compare keys. - /// The value with the maximum key in the sequence. - /// is . - /// No key extracted from implements the or interface. - /// - /// If is a reference type and the source sequence is empty or contains only values that are , this method returns . - /// - internal static TSource? MaxBy(this IEnumerable source, Func keySelector, IComparer? comparer) - { - Verify.ArgNotNull(source); - Verify.ArgNotNull(keySelector); - - comparer ??= Comparer.Default; - - using IEnumerator e = source.GetEnumerator(); - - if (!e.MoveNext()) - { - if (default(TSource) is null) - { - return default; - } - else - { - throw new InvalidOperationException("No elements."); - } - } - - var value = e.Current; - var key = keySelector(value); - - if (default(TKey) is null) - { - if (key is null) - { - var firstValue = value; - - do - { - if (!e.MoveNext()) - { - // All keys are null, surface the first element. - return firstValue; - } - - value = e.Current; - key = keySelector(value); - } - while (key is null); - } - - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (nextKey is not null && comparer.Compare(nextKey, key) > 0) - { - key = nextKey; - value = nextValue; - } - } - } - else - { - if (Equals(comparer, Comparer.Default)) - { - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (Comparer.Default.Compare(nextKey, key) > 0) - { - key = nextKey; - value = nextValue; - } - } - } - else - { - while (e.MoveNext()) - { - var nextValue = e.Current; - var nextKey = keySelector(nextValue); - if (comparer.Compare(nextKey, key) > 0) - { - key = nextKey; - value = nextValue; - } - } - } - } - - return value; - } } diff --git a/TUnit.Engine/Services/Counter.cs b/TUnit.Engine/Services/Counter.cs index b19cfcc00b..5e1b5aa2ff 100644 --- a/TUnit.Engine/Services/Counter.cs +++ b/TUnit.Engine/Services/Counter.cs @@ -5,7 +5,7 @@ namespace TUnit.Engine.Services; [DebuggerDisplay("Count = {CurrentCount}")] public class Counter { - private readonly Lock _locker = LockFactory.Create(); + private readonly Lock _locker = new(); private int _count; diff --git a/TUnit.Engine/Services/SingleTestExecutor.cs b/TUnit.Engine/Services/SingleTestExecutor.cs index 31f99eb59f..cda1e7b6f1 100644 --- a/TUnit.Engine/Services/SingleTestExecutor.cs +++ b/TUnit.Engine/Services/SingleTestExecutor.cs @@ -33,7 +33,7 @@ internal class SingleTestExecutor( TestRegistrar testRegistrar) : IDataProducer { - private static readonly Lock Lock = LockFactory.Create(); + private static readonly Lock Lock = new(); public Task ExecuteTestAsync(DiscoveredTest test, ITestExecutionFilter? filter, ExecuteRequestContext context, bool isStartedAsDependencyForAnotherTest) diff --git a/TUnit.Engine/Services/TestsExecutor.cs b/TUnit.Engine/Services/TestsExecutor.cs index 2eef8bad52..c7110a7370 100644 --- a/TUnit.Engine/Services/TestsExecutor.cs +++ b/TUnit.Engine/Services/TestsExecutor.cs @@ -2,6 +2,7 @@ using Microsoft.Testing.Platform.CommandLine; using Microsoft.Testing.Platform.Extensions.TestFramework; using Microsoft.Testing.Platform.Requests; +using Polyfills; using TUnit.Core; using TUnit.Engine.CommandLineProviders; using TUnit.Engine.Logging; diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index 89abdb26d5..d2be7c71e3 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -5,10 +5,11 @@ false preview + LAUNCH_DEBUGGER - + diff --git a/TUnit.Engine/TUnitMessageBus.cs b/TUnit.Engine/TUnitMessageBus.cs index 31ce1e1556..809d733ace 100644 --- a/TUnit.Engine/TUnitMessageBus.cs +++ b/TUnit.Engine/TUnitMessageBus.cs @@ -3,6 +3,7 @@ using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Extensions.TestFramework; using Microsoft.Testing.Platform.TestHost; +using Polyfills; using TUnit.Core; using TUnit.Engine.Extensions; #pragma warning disable TPEXP diff --git a/TUnit.Playwright/WorkerAwareTest.cs b/TUnit.Playwright/WorkerAwareTest.cs index 9555ab81a7..b1ecd966b1 100644 --- a/TUnit.Playwright/WorkerAwareTest.cs +++ b/TUnit.Playwright/WorkerAwareTest.cs @@ -77,6 +77,8 @@ public ValueTask OnTestRegistered(TestRegisteredContext context) context.SetParallelLimiter(new DefaultPlaywrightParallelLimiter()); } - return ValueTask.CompletedTask; + return default; } + + int IEventReceiver.Order => 0; } From d5d27f6657ee8aa8513aa7aa7081110b39d6f5dd Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:23:40 +0000 Subject: [PATCH 12/71] Fixes --- .../CodeGenerators/PolyfillGenerator.cs | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs index 1b2de7c6f7..6cc0721fe5 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs @@ -45,38 +45,39 @@ public void Initialize(IncrementalGeneratorInitializationContext context) context.RegisterSourceOutput(context.CompilationProvider .WithComparer(new PreventCompilationTriggerOnEveryKeystrokeComparer()), (productionContext, compilation) => { - if (compilation.SupportsRuntimeCapability(RuntimeCapability.DefaultImplementationsOfInterfaces)) + if (!compilation.ContainsSymbolsWithName("System.Runtime.CompilerServices.ModuleInitializerAttribute", SymbolFilter.Type)) { - return; - } + productionContext.AddSource("ModuleInitializerAttribute.g.cs", + """ + namespace System.Runtime.CompilerServices; - productionContext.AddSource("ModuleInitializerAttribute.g.cs", - """ - namespace System.Runtime.CompilerServices; + using System; + using System.Diagnostics; + using System.Diagnostics.CodeAnalysis; - using System; - using System.Diagnostics; - using System.Diagnostics.CodeAnalysis; + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + sealed class ModuleInitializerAttribute : Attribute; + """); + } - [AttributeUsage(AttributeTargets.Method, Inherited = false)] - sealed class ModuleInitializerAttribute : Attribute; - """); - - productionContext.AddSource("StackTraceHiddenAttribute.g.cs", - """ - namespace System.Diagnostics; + if (!compilation.ContainsSymbolsWithName("System.Diagnostics.StackTraceHiddenAttribute", SymbolFilter.Type)) + { + productionContext.AddSource("StackTraceHiddenAttribute.g.cs", + """ + namespace System.Diagnostics; - using System; - using System.Diagnostics.CodeAnalysis; + using System; + using System.Diagnostics.CodeAnalysis; - [AttributeUsage( - AttributeTargets.Class | - AttributeTargets.Method | - AttributeTargets.Constructor | - AttributeTargets.Struct, - Inherited = false)] - sealed class StackTraceHiddenAttribute : Attribute; - """); + [AttributeUsage( + AttributeTargets.Class | + AttributeTargets.Method | + AttributeTargets.Constructor | + AttributeTargets.Struct, + Inherited = false)] + sealed class StackTraceHiddenAttribute : Attribute; + """); + } }); } } \ No newline at end of file From 1bcb7d07815b7fb01158bcf96468c5caba04b244 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:42:58 +0000 Subject: [PATCH 13/71] Source Gen tweaks --- .../Writers/Hooks/AssemblyHooksWriter.cs | 2 +- .../Writers/Hooks/ClassHooksWriter.cs | 2 +- .../Writers/Hooks/GlobalTestHooksWriter.cs | 2 +- .../Writers/Hooks/TestHooksWriter.cs | 4 +- .../Writers/MethodInfoWriter.cs | 3 +- TUnit.Playwright/TUnit.Playwright.csproj | 37 +++++++++++-------- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs index ff30e17f1f..7e4daeb0d0 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs @@ -23,7 +23,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel? model } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = typeof({model.FullyQualifiedTypeName}).GetMethod("{model.MethodName}", 0, [{string.Join(", ", model.ParameterTypes.Select(x => $"typeof({x})"))}]),"""); + sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs index 73031b3cd7..62ef021c67 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs @@ -18,7 +18,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = typeof({model.FullyQualifiedTypeName}).GetMethod("{model.MethodName}", 0, [{string.Join(", ", model.ParameterTypes.Select(x => $"typeof({x})"))}]),"""); + sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs index 214d0206fb..db94195291 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs @@ -10,7 +10,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) { sourceBuilder.WriteLine($"new {GetClassType(model.HookLevel, model.HookLocationType)}"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = typeof({model.FullyQualifiedTypeName}).GetMethod("{model.MethodName}", 0, [{string.Join(", ", model.ParameterTypes.Select(x => $"typeof({x})"))}]),"""); + sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); if (model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index 8fa92357b1..8440f5ffe7 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -20,7 +20,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = typeof({model.FullyQualifiedTypeName}).GetMethod("{model.MethodName}", 0, [{string.Join(", ", model.ParameterTypes.Select(x => $"typeof({x})"))}]),"""); + sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); if(model.IsVoid) { @@ -42,7 +42,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"new InstanceHookMethod<{model.FullyQualifiedTypeName}>"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = typeof({model.FullyQualifiedTypeName}).GetMethod("{model.MethodName}", 0, [{string.Join(", ", model.ParameterTypes.Select(x => $"typeof({x})"))}]),"""); + sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs index 55a4f1106f..562c7f1c4c 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs @@ -8,8 +8,7 @@ public static string Write(TestSourceDataModel testSourceDataModel, string metho { if (testSourceDataModel.MethodGenericTypeCount == 0) { - return - $"typeof({testSourceDataModel.FullyQualifiedTypeName}).GetMethod(\"{testSourceDataModel.MethodName}\", {testSourceDataModel.MethodGenericTypeCount}, [{methodParameterTypesList}])"; + return $"((Action<{string.Join(", ", methodParameterTypesList)}>)(({testSourceDataModel.FullyQualifiedTypeName} instance) => instance.{testSourceDataModel.MethodName})).Method"; } return diff --git a/TUnit.Playwright/TUnit.Playwright.csproj b/TUnit.Playwright/TUnit.Playwright.csproj index d9a0f66923..f845a31f76 100644 --- a/TUnit.Playwright/TUnit.Playwright.csproj +++ b/TUnit.Playwright/TUnit.Playwright.csproj @@ -1,20 +1,27 @@  - - true - + + true + - - - + + + - - - - - - - - + + + - + + true + EmittedSourceGeneratedFiles + + + + + + + + \ No newline at end of file From f0b613455a6617e6d20bff9f255f296666a64f83 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:01:21 +0000 Subject: [PATCH 14/71] Fixes --- .../Writers/FailedTestInitializationWriter.cs | 2 +- .../Writers/GenericTestInvocationWriter.cs | 4 +-- .../Writers/Hooks/AssemblyHooksWriter.cs | 2 +- .../Writers/Hooks/ClassHooksWriter.cs | 2 +- .../Writers/Hooks/GlobalTestHooksWriter.cs | 2 +- .../Writers/Hooks/TestHooksWriter.cs | 4 +-- .../Writers/MethodInfoWriter.cs | 27 +++++++------------ TUnit.Playwright/TUnit.Playwright.csproj | 7 +---- .../TUnit.TestProject.Library.csproj | 5 ++++ 9 files changed, 23 insertions(+), 32 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs index 48e1e16c1c..c512186155 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs @@ -14,7 +14,7 @@ public static void GenerateFailedTestCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine("{"); sourceBuilder.WriteLine($"TestId = $\"{testId}\","); sourceBuilder.WriteLine($"TestClass = typeof({testSourceDataModel.FullyQualifiedTypeName}),"); - sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel, testSourceDataModel.MethodParameterOrArgumentNonGenericTypes.Select(x => $"typeof({x})").ToCommaSeparatedString())}.ReturnType,"); + sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes)}.ReturnType,"); sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterOrArgumentNonGenericTypes.Select(x => $"typeof({x})"))}],"); sourceBuilder.WriteLine($"TestName = \"{testSourceDataModel.MethodName}\","); sourceBuilder.WriteLine($"TestFilePath = @\"{testSourceDataModel.FilePath}\","); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs index b4bf570db5..da4e698cd6 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs @@ -13,11 +13,9 @@ public static void GenerateTestInvocationCode(SourceCodeWriter sourceBuilder, var fullyQualifiedClassType = testSourceDataModel.FullyQualifiedTypeName; - var methodParameterTypesList = string.Join(", ", testSourceDataModel.MethodParameterOrArgumentNonGenericTypes.Select(x => $"typeof({x})")); - sourceBuilder.WriteLine($"var testClassType = typeof({fullyQualifiedClassType});"); - sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel, methodParameterTypesList)};"); + sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes)};"); sourceBuilder.WriteLine(); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs index 7e4daeb0d0..dec7880ebb 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs @@ -23,7 +23,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel? model } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs index 62ef021c67..9342349b4f 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs @@ -18,7 +18,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs index db94195291..4f956d08b6 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs @@ -10,7 +10,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) { sourceBuilder.WriteLine($"new {GetClassType(model.HookLevel, model.HookLocationType)}"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); if (model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index 8440f5ffe7..35cf056661 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -20,7 +20,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); if(model.IsVoid) { @@ -42,7 +42,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"new InstanceHookMethod<{model.FullyQualifiedTypeName}>"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = ((Action<{string.Join(", ", model.ParameterTypes)}>)(({model.FullyQualifiedTypeName} instance) => instance.{model.MethodName})).Method"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs index 562c7f1c4c..711a596229 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs @@ -1,25 +1,18 @@ -using TUnit.Core.SourceGenerator.Models; - -namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers; +namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers; public static class MethodInfoWriter { - public static string Write(TestSourceDataModel testSourceDataModel, string methodParameterTypesList) + public static string Write(string type, string methodName, string[] parameters) { - if (testSourceDataModel.MethodGenericTypeCount == 0) - { - return $"((Action<{string.Join(", ", methodParameterTypesList)}>)(({testSourceDataModel.FullyQualifiedTypeName} instance) => instance.{testSourceDataModel.MethodName})).Method"; - } + string[] actionTypes = + [ + type, + ..parameters + ]; + var actionLambdaParameters = actionTypes.Select((x, i) => $"{x} a{i}"); + return - $""" - typeof({testSourceDataModel.FullyQualifiedTypeName}) - .GetMethods() - .Where(method => method.IsPublic) - .Where(method => method.Name == "{testSourceDataModel.MethodName}") - .Where(method => method.GetParameters().Length == {testSourceDataModel.MethodParameterTypes.Length}) - .Where(method => method.GetGenericArguments().Length == {testSourceDataModel.MethodGenericTypeCount}) - .First() - """; + $"((Action<{string.Join(", ", actionTypes)}>)(({string.Join(", ", actionLambdaParameters)}) => a0.{methodName}({string.Join(", ", parameters.Select((x, i) => $"a{i+1}"))}))).Method"; } } \ No newline at end of file diff --git a/TUnit.Playwright/TUnit.Playwright.csproj b/TUnit.Playwright/TUnit.Playwright.csproj index f845a31f76..e51b14a7ee 100644 --- a/TUnit.Playwright/TUnit.Playwright.csproj +++ b/TUnit.Playwright/TUnit.Playwright.csproj @@ -12,16 +12,11 @@ - - true - EmittedSourceGeneratedFiles - - - + \ No newline at end of file diff --git a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj index 6cae9bf356..36b31b68e6 100644 --- a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj +++ b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj @@ -6,6 +6,11 @@ false + + true + EmittedSourceGeneratedFiles + + From 5170cb23d9e6f7f5435d194c113e3f0e9c3540a9 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:07:31 +0000 Subject: [PATCH 15/71] Fixes --- .../Writers/FailedTestInitializationWriter.cs | 2 +- .../Writers/GenericTestInvocationWriter.cs | 2 +- .../Writers/Hooks/AssemblyHooksWriter.cs | 2 +- .../Writers/Hooks/ClassHooksWriter.cs | 2 +- .../Writers/Hooks/GlobalTestHooksWriter.cs | 2 +- .../Writers/Hooks/TestHooksWriter.cs | 4 ++-- .../Writers/MethodInfoWriter.cs | 19 ++++++++++++++++++- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs index c512186155..37762e5578 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs @@ -14,7 +14,7 @@ public static void GenerateFailedTestCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine("{"); sourceBuilder.WriteLine($"TestId = $\"{testId}\","); sourceBuilder.WriteLine($"TestClass = typeof({testSourceDataModel.FullyQualifiedTypeName}),"); - sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes)}.ReturnType,"); + sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes, false)}.ReturnType,"); sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterOrArgumentNonGenericTypes.Select(x => $"typeof({x})"))}],"); sourceBuilder.WriteLine($"TestName = \"{testSourceDataModel.MethodName}\","); sourceBuilder.WriteLine($"TestFilePath = @\"{testSourceDataModel.FilePath}\","); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs index da4e698cd6..90d36fd1f5 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs @@ -15,7 +15,7 @@ public static void GenerateTestInvocationCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine($"var testClassType = typeof({fullyQualifiedClassType});"); - sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes)};"); + sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes, false)};"); sourceBuilder.WriteLine(); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs index dec7880ebb..c6f6a15ec4 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs @@ -23,7 +23,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel? model } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs index 9342349b4f..44b484bff8 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs @@ -18,7 +18,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs index 4f956d08b6..b00073b356 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs @@ -10,7 +10,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) { sourceBuilder.WriteLine($"new {GetClassType(model.HookLevel, model.HookLocationType)}"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); if (model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index 35cf056661..ccf750adb8 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -20,7 +20,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, false)},"""); if(model.IsVoid) { @@ -42,7 +42,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"new InstanceHookMethod<{model.FullyQualifiedTypeName}>"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, false)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs index 711a596229..902c5c74b3 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs @@ -2,7 +2,12 @@ public static class MethodInfoWriter { - public static string Write(string type, string methodName, string[] parameters) + public static string Write(string type, string methodName, string[] parameters, bool isStatic) + { + return isStatic ? WriteStatic(type, methodName, parameters) : WriteInstance(type, methodName, parameters); + } + + private static string WriteInstance(string type, string methodName, string[] parameters) { string[] actionTypes = [ @@ -15,4 +20,16 @@ public static string Write(string type, string methodName, string[] parameters) return $"((Action<{string.Join(", ", actionTypes)}>)(({string.Join(", ", actionLambdaParameters)}) => a0.{methodName}({string.Join(", ", parameters.Select((x, i) => $"a{i+1}"))}))).Method"; } + + private static string WriteStatic(string type, string methodName, string[] parameters) + { + var actionType = parameters.Length == 0 + ? "Action" + : $"Action<{string.Join(", ", parameters)}>"; + + var actionLambdaParameters = parameters.Select((x, i) => $"{x} a{i}"); + + return + $"(({actionType})(({string.Join(", ", actionLambdaParameters)}) => {type}.{methodName}({string.Join(", ", parameters.Select((x, i) => $"a{i}"))}))).Method"; + } } \ No newline at end of file From 7885160b80575132999748ac724e74847c471d47 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:15:12 +0000 Subject: [PATCH 16/71] Fixes --- .../CodeGenerators/PolyfillGenerator.cs | 4 ++-- .../CodeGenerators/Writers/Hooks/TestHooksWriter.cs | 4 ++-- TUnit.Playwright/PlaywrightSkipAttribute.cs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs index 6cc0721fe5..c3eaacd612 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/PolyfillGenerator.cs @@ -45,7 +45,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) context.RegisterSourceOutput(context.CompilationProvider .WithComparer(new PreventCompilationTriggerOnEveryKeystrokeComparer()), (productionContext, compilation) => { - if (!compilation.ContainsSymbolsWithName("System.Runtime.CompilerServices.ModuleInitializerAttribute", SymbolFilter.Type)) + if (compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.ModuleInitializerAttribute") == null) { productionContext.AddSource("ModuleInitializerAttribute.g.cs", """ @@ -60,7 +60,7 @@ sealed class ModuleInitializerAttribute : Attribute; """); } - if (!compilation.ContainsSymbolsWithName("System.Diagnostics.StackTraceHiddenAttribute", SymbolFilter.Type)) + if (compilation.GetTypeByMetadataName("System.Diagnostics.StackTraceHiddenAttribute") == null) { productionContext.AddSource("StackTraceHiddenAttribute.g.cs", """ diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index ccf750adb8..c5416a26a1 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -20,7 +20,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, false)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, model.IsEveryHook)},"""); if(model.IsVoid) { @@ -42,7 +42,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"new InstanceHookMethod<{model.FullyQualifiedTypeName}>"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, false)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, model.IsEveryHook)},"""); if(model.IsVoid) { diff --git a/TUnit.Playwright/PlaywrightSkipAttribute.cs b/TUnit.Playwright/PlaywrightSkipAttribute.cs index 55f2ddedb4..2fd29ab3a7 100644 --- a/TUnit.Playwright/PlaywrightSkipAttribute.cs +++ b/TUnit.Playwright/PlaywrightSkipAttribute.cs @@ -36,7 +36,8 @@ public override Task ShouldSkip(BeforeTestContext context) return Task.FromResult(_combinations.Any(combination => { - var requirements = Enum.GetValues().Where(x => combination.HasFlag(x)); + var targets = Enum.GetValues(typeof(Targets)).OfType(); + var requirements = targets.Where(x => combination.HasFlag(x)); return requirements.All(flag => flag switch { From e762215187699d28bafad698d49e56f76eea7703 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:28:12 +0000 Subject: [PATCH 17/71] Fixes --- .../Helpers/TestSourceDataModelRetriever.cs | 26 +++++++++++++------ .../Writers/FailedTestInitializationWriter.cs | 2 +- .../Models/TestSourceDataModel.cs | 5 +--- .../TUnit.TestProject.Library.csproj | 9 +++---- TUnit.TestProject/TUnit.TestProject.csproj | 4 +-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index e54132a13e..c35f72cdb3 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -131,11 +131,6 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext var methodNonGenericTypes = GetNonGenericTypes(testGenerationContext.MethodSymbol.Parameters, testArguments.GetArgumentTypes()); - - var classNonGenericTypes = - GetNonGenericTypes( - testGenerationContext.ClassSymbol.InstanceConstructors.FirstOrDefault()?.Parameters ?? ImmutableArray.Empty, - classArguments.GetArgumentTypes()); return new TestSourceDataModel { @@ -148,12 +143,10 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext RepeatLimit = TestInformationRetriever.GetRepeatCount(allAttributes), CurrentRepeatAttempt = testGenerationContext.CurrentRepeatAttempt, ClassArguments = classArguments, - ClassParameterOrArgumentNonGenericTypes = classNonGenericTypes.ToArray(), MethodArguments = testArguments, FilePath = testAttribute.ConstructorArguments[0].Value?.ToString() ?? string.Empty, LineNumber = testAttribute.ConstructorArguments[1].Value as int? ?? 0, - MethodParameterTypes = [..methodSymbol.Parameters.Select(x => x.Type.GloballyQualified())], - MethodParameterOrArgumentNonGenericTypes = methodNonGenericTypes.ToArray(), + MethodParameterTypes = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], MethodParameterNames = [..methodSymbol.Parameters.Select(x => x.Name)], MethodGenericTypeCount = methodSymbol.TypeParameters.Length, TestExecutor = allAttributes.FirstOrDefault(x => x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true)?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), @@ -163,6 +156,23 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext }; } + private static IEnumerable GetParameterTypes(IMethodSymbol methodSymbol, string[] argumentTypes) + { + for (var index = 0; index < methodSymbol.Parameters.Length; index++) + { + var parameter = methodSymbol.Parameters[index]; + + if (parameter.Type.IsGenericDefinition()) + { + yield return argumentTypes[index]; + } + else + { + yield return parameter.Type.GloballyQualified(); + } + } + } + private static IEnumerable GetNonGenericTypes(ImmutableArray methodSymbolParameters, string[] argumentTypes) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs index 37762e5578..e67155ee90 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs @@ -15,7 +15,7 @@ public static void GenerateFailedTestCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine($"TestId = $\"{testId}\","); sourceBuilder.WriteLine($"TestClass = typeof({testSourceDataModel.FullyQualifiedTypeName}),"); sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes, false)}.ReturnType,"); - sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterOrArgumentNonGenericTypes.Select(x => $"typeof({x})"))}],"); + sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterTypes.Select(x => $"typeof({x})"))}],"); sourceBuilder.WriteLine($"TestName = \"{testSourceDataModel.MethodName}\","); sourceBuilder.WriteLine($"TestFilePath = @\"{testSourceDataModel.FilePath}\","); sourceBuilder.WriteLine($"TestLineNumber = {testSourceDataModel.LineNumber},"); diff --git a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs index f2257ef365..b40b0b5751 100644 --- a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs +++ b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs @@ -46,14 +46,11 @@ public override int GetHashCode() public required string MethodName { get; init; } public required BaseContainer ClassArguments { get; init; } - public required string[] ClassParameterOrArgumentNonGenericTypes { get; init; } - public required BaseContainer MethodArguments { get; init; } public required string[] MethodParameterTypes { get; init; } public required string[] MethodParameterNames { get; init; } - public required string[] MethodParameterOrArgumentNonGenericTypes { get; init; } - + public required int MethodGenericTypeCount { get; init; } public required string TestId { get; init; } diff --git a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj index 36b31b68e6..504c959c62 100644 --- a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj +++ b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj @@ -6,11 +6,6 @@ false - - true - EmittedSourceGeneratedFiles - - @@ -18,4 +13,8 @@ + + + + diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index 3f979b75ab..4318b90cd1 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -46,8 +46,8 @@ - - + true + EmittedSourceGeneratedFiles From 329d4383371fe24f0aa483c9111dddeb3cc6280c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:34:05 +0000 Subject: [PATCH 18/71] Fix --- TUnit.TestProject/TUnit.TestProject.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index 4318b90cd1..eac9298b35 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -46,8 +46,8 @@ - true - EmittedSourceGeneratedFiles + + From 2aeaa6f67ca3d29ba5b4e95017168874537eaca0 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:40:48 +0000 Subject: [PATCH 19/71] Fixes --- .../Helpers/TestSourceDataModelRetriever.cs | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index c35f72cdb3..9efd5595d7 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -118,7 +118,7 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext AttributeData[] allAttributes = [ - ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime"), + ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true), ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime"), ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime") ]; @@ -128,9 +128,6 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext .Select(x => x.PropertySymbol) .SelectMany(x => x.GetAttributes()) .Where(x => x.IsDataSourceAttribute()); - - var methodNonGenericTypes = GetNonGenericTypes(testGenerationContext.MethodSymbol.Parameters, - testArguments.GetArgumentTypes()); return new TestSourceDataModel { @@ -172,22 +169,4 @@ private static IEnumerable GetParameterTypes(IMethodSymbol methodSymbol, } } } - - private static IEnumerable GetNonGenericTypes(ImmutableArray methodSymbolParameters, - string[] argumentTypes) - { - for (var i = 0; i < methodSymbolParameters.Length; i++) - { - var parameter = methodSymbolParameters[i]; - - if (parameter.Type.IsGenericDefinition()) - { - yield return argumentTypes.ElementAtOrDefault(i) ?? "global::System.Threading.CancellationToken"; - } - else - { - yield return parameter.Type.GloballyQualified(); - } - } - } } \ No newline at end of file From 0f65a90a8f521218d32c3191b549ec6d708cc1bc Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:42:54 +0000 Subject: [PATCH 20/71] Fixes --- .../CodeGenerators/Helpers/TestSourceDataModelRetriever.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 9efd5595d7..0691daeef0 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -119,8 +119,8 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext AttributeData[] allAttributes = [ ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true), - ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime"), - ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime") + ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true), + ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true) ]; var propertyAttributes = testGenerationContext.PropertyArguments From 7545d126078a8fea3de609ac5fbbe62c9163be70 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:44:30 +0000 Subject: [PATCH 21/71] ContainingNamespace --- .../CodeGenerators/Helpers/TestSourceDataModelRetriever.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 0691daeef0..72b034e949 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -118,9 +118,9 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext AttributeData[] allAttributes = [ - ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true), - ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true), - ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingAssembly.Name.StartsWith("System") != true) + ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true), + ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true), + ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true) ]; var propertyAttributes = testGenerationContext.PropertyArguments From 486630a8d7952d7cbd98eff890e61dd321969b4b Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:00:08 +0000 Subject: [PATCH 22/71] Fixes --- .../CodeGenerators/Helpers/TestSourceDataModelRetriever.cs | 2 +- TUnit.TestProject.Library/TUnit.TestProject.Library.csproj | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 72b034e949..c77233adb8 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -126,7 +126,7 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext var propertyAttributes = testGenerationContext.PropertyArguments .InnerContainers .Select(x => x.PropertySymbol) - .SelectMany(x => x.GetAttributes()) + .SelectMany(x => x.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true)) .Where(x => x.IsDataSourceAttribute()); return new TestSourceDataModel diff --git a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj index 504c959c62..297a1a0e86 100644 --- a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj +++ b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj @@ -12,9 +12,4 @@ - - - - - From 78137acdbf5ee9282d13ab5ba476a75f5bbb3a4c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:14:19 +0000 Subject: [PATCH 23/71] Fixes --- .../Helpers/TestSourceDataModelRetriever.cs | 28 +++++++++++++------ .../Extensions/EnumerableExtensions.cs | 9 +++++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index c77233adb8..eb5b595418 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -23,7 +23,7 @@ public static IEnumerable ParseTestDatas(this IMethodSymbol var constructorParameters = namedTypeSymbol.InstanceConstructors.FirstOrDefault()?.Parameters ?? ImmutableArray.Empty; var classArgumentsContainers = ArgumentsRetriever.GetArguments(context, constructorParameters, constructorParameters.Select(x => x.Type).ToImmutableArray(), GetClassAttributes(namedTypeSymbol).Concat(namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.IsDataSourceAttribute())).ToImmutableArray(), namedTypeSymbol, ArgumentsType.ClassConstructor).ToArray(); var methodParametersWithoutCancellationToken = methodSymbol.Parameters.WithoutCancellationTokenParameter(); - var testArgumentsContainers = ArgumentsRetriever.GetArguments(context, methodParametersWithoutCancellationToken, methodParametersWithoutCancellationToken.Select(x => x.Type).ToImmutableArray(), methodSymbol.GetAttributes(), namedTypeSymbol, ArgumentsType.Method); + var testArgumentsContainers = ArgumentsRetriever.GetArguments(context, methodParametersWithoutCancellationToken, methodParametersWithoutCancellationToken.Select(x => x.Type).ToImmutableArray(), methodSymbol.GetAttributes().ToImmutableArray(), namedTypeSymbol, ArgumentsType.Method); var propertyArgumentsContainer = ArgumentsRetriever.GetProperties(context, namedTypeSymbol); var repeatCount = @@ -118,17 +118,17 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext AttributeData[] allAttributes = [ - ..methodSymbol.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true), - ..namedTypeSymbol.GetAttributesIncludingBaseTypes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true), - ..namedTypeSymbol.ContainingAssembly.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true) + ..methodSymbol.GetAttributes(), + ..namedTypeSymbol.GetAttributesIncludingBaseTypes(), + ..namedTypeSymbol.ContainingAssembly.GetAttributes() ]; var propertyAttributes = testGenerationContext.PropertyArguments .InnerContainers .Select(x => x.PropertySymbol) - .SelectMany(x => x.GetAttributes().Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true)) + .SelectMany(x => x.GetAttributes()) .Where(x => x.IsDataSourceAttribute()); - + return new TestSourceDataModel { TestId = TestInformationRetriever.GetTestId(testGenerationContext), @@ -146,9 +146,19 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext MethodParameterTypes = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], MethodParameterNames = [..methodSymbol.Parameters.Select(x => x.Name)], MethodGenericTypeCount = methodSymbol.TypeParameters.Length, - TestExecutor = allAttributes.FirstOrDefault(x => x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true)?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), - AttributeTypes = allAttributes.Where(x => !x.IsDataSourceAttribute()).Select(x => x.AttributeClass?.GloballyQualified()).OfType().Distinct().ToArray(), - PropertyAttributeTypes = propertyAttributes.Select(x => x.AttributeClass?.GloballyQualified()).OfType().ToArray(), + TestExecutor = allAttributes + .FirstOrDefault(x => + x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true) + ?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), + AttributeTypes = allAttributes.ExceptSystemAttributes() + .Where(x => x.AttributeClass!.DeclaredAccessibility == Accessibility.Public) + .Where(x => !x.IsDataSourceAttribute()) + .Select(x => x.AttributeClass?.GloballyQualified()) + .OfType() + .Distinct() + .ToArray(), + PropertyAttributeTypes = propertyAttributes.Select(x => x.AttributeClass?.GloballyQualified()) + .OfType().ToArray(), PropertyArguments = testGenerationContext.PropertyArguments, }; } diff --git a/TUnit.Core.SourceGenerator/Extensions/EnumerableExtensions.cs b/TUnit.Core.SourceGenerator/Extensions/EnumerableExtensions.cs index 45cd4c29b6..0b86482e06 100644 --- a/TUnit.Core.SourceGenerator/Extensions/EnumerableExtensions.cs +++ b/TUnit.Core.SourceGenerator/Extensions/EnumerableExtensions.cs @@ -1,4 +1,6 @@ -namespace TUnit.Core.SourceGenerator.Extensions; +using Microsoft.CodeAnalysis; + +namespace TUnit.Core.SourceGenerator.Extensions; public static class EnumerableExtensions { @@ -6,4 +8,9 @@ public static string ToCommaSeparatedString(this IEnumerable enumerable) { return string.Join(", ", enumerable); } + + public static IEnumerable ExceptSystemAttributes(this IEnumerable attributeDatas) + { + return attributeDatas.Where(x => x.AttributeClass?.ContainingNamespace.Name.StartsWith("System") != true); + } } \ No newline at end of file From f718f477010936811c61e2076f79ccd6c311464b Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:34:46 +0000 Subject: [PATCH 24/71] More net472 --- TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj | 4 +++- TUnit.Pipeline/Modules/RunAssertionsTestsModule.cs | 2 +- TUnit.Pipeline/Modules/RunAssertionsUnitTestsModule.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj b/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj index 14f99effa7..a985d00a66 100644 --- a/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj +++ b/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj @@ -1,6 +1,8 @@  + + - net8.0 + true preview true false diff --git a/TUnit.Pipeline/Modules/RunAssertionsTestsModule.cs b/TUnit.Pipeline/Modules/RunAssertionsTestsModule.cs index b052e01960..9e6ffc3ac5 100644 --- a/TUnit.Pipeline/Modules/RunAssertionsTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunAssertionsTestsModule.cs @@ -20,7 +20,7 @@ public class RunAssertionsTestsModule : Module { NoBuild = true, Configuration = Configuration.Release, - Framework = "net8.0" + Framework = Environment.GetEnvironmentVariable("NET_VERSION") }, cancellationToken); } } \ No newline at end of file diff --git a/TUnit.Pipeline/Modules/RunAssertionsUnitTestsModule.cs b/TUnit.Pipeline/Modules/RunAssertionsUnitTestsModule.cs index 43666b5172..71b8058c1c 100644 --- a/TUnit.Pipeline/Modules/RunAssertionsUnitTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunAssertionsUnitTestsModule.cs @@ -20,7 +20,7 @@ public class RunAssertionsUnitTestsModule : Module { NoBuild = true, Configuration = Configuration.Release, - Framework = "net8.0" + Framework = Environment.GetEnvironmentVariable("NET_VERSION") }, cancellationToken); } } \ No newline at end of file From 92935d4996738ebd81178c63560ad3a9daf2cd3e Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:43:43 +0000 Subject: [PATCH 25/71] IsLibraryTestProject --- TUnit.TestProject/TUnit.TestProject.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index eac9298b35..e0b0727e2b 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -1,5 +1,6 @@ + true false true Exe From 1f2a40979ce53d5eaf6d13b412c11e6abbb46a26 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:45:13 +0000 Subject: [PATCH 26/71] Remove reference --- TUnit.TestProject/TUnit.TestProject.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index e0b0727e2b..3a653c2f86 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -36,7 +36,6 @@ - From bb6011a7514f6d58e77cd84b416fe520b0caec88 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:45:43 +0000 Subject: [PATCH 27/71] Fix --- TUnit.TestProject.Library/TUnit.TestProject.Library.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj index 297a1a0e86..93bcab00ed 100644 --- a/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj +++ b/TUnit.TestProject.Library/TUnit.TestProject.Library.csproj @@ -1,6 +1,7 @@  + true enable enable false From 94d7d7819e345a93f7439a424d15a6d2e34924f3 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:49:58 +0000 Subject: [PATCH 28/71] Rework props --- Directory.Build.targets | 2 ++ TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj | 1 - TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj | 1 - TUnit.Assertions/TUnit.Assertions.csproj | 1 - TUnit.Core/TUnit.Core.csproj | 1 - 5 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index c766640788..d6e8deb46f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,4 +1,6 @@ + + netstandard2.0;net8.0;net9.0 net472;net8.0;net9.0 diff --git a/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj b/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj index a985d00a66..62c055fc78 100644 --- a/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj +++ b/TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj @@ -1,5 +1,4 @@  - true diff --git a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj index cb298bcd16..333182931c 100644 --- a/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj +++ b/TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj @@ -1,5 +1,4 @@  - true diff --git a/TUnit.Assertions/TUnit.Assertions.csproj b/TUnit.Assertions/TUnit.Assertions.csproj index f0e2d0de51..aa49241bdf 100644 --- a/TUnit.Assertions/TUnit.Assertions.csproj +++ b/TUnit.Assertions/TUnit.Assertions.csproj @@ -1,5 +1,4 @@  - true diff --git a/TUnit.Core/TUnit.Core.csproj b/TUnit.Core/TUnit.Core.csproj index abd88d3ea8..66dd5186d7 100644 --- a/TUnit.Core/TUnit.Core.csproj +++ b/TUnit.Core/TUnit.Core.csproj @@ -1,5 +1,4 @@  - true From 8ecbf4eaea128ac3c7356e1b2029ef51b6553992 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:52:52 +0000 Subject: [PATCH 29/71] MSBuildThisFileDirectory --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index d6e8deb46f..611dc5b16c 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,5 @@ - + netstandard2.0;net8.0;net9.0 From aba955e75bc6053a06c09e8399fed939277f9a2c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:58:30 +0000 Subject: [PATCH 30/71] Fixes --- Directory.Packages.props | 1 + TUnit.TestProject/SetupTests.cs | 133 --------------------- TUnit.TestProject/TUnit.TestProject.csproj | 1 + 3 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 TUnit.TestProject/SetupTests.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 4822c092a6..5aafb7fd9e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,6 +27,7 @@ + diff --git a/TUnit.TestProject/SetupTests.cs b/TUnit.TestProject/SetupTests.cs deleted file mode 100644 index 4db935ea63..0000000000 --- a/TUnit.TestProject/SetupTests.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System.Net; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Hosting.Server.Features; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.DependencyInjection; -using TUnit.Assertions; -using TUnit.Assertions.Extensions; - -namespace TUnit.TestProject; - -public class Base1 -{ - [Before(Class)] - public static async Task BeforeAll1() - { - await Task.CompletedTask; - } - - [Before(Test)] - public async Task BeforeEach1() - { - await Task.CompletedTask; - } -} - -public class Base2 : Base1 -{ - [Before(Class)] - public static async Task BeforeAll2() - { - await Task.CompletedTask; - } - - [Before(Test)] - public async Task BeforeEach2() - { - await Task.CompletedTask; - } -} - -public class Base3 : Base2 -{ - [Before(Class)] - public static async Task BeforeAll3() - { - await Task.CompletedTask; - } - - [Before(Test)] - public async Task BeforeEach3() - { - await Task.CompletedTask; - } -} - -public class SetupTests : Base3 -{ - private static WebApplication _app = null!; - private static string _serverAddress = null!; - private HttpResponseMessage? _response; - - private static int _beforeAllTestsInClassExecutionCount; - private static int _afterAllTestsInClassExecutionCount; - - [Before(Class)] - public static async Task SetUpLocalWebServer() - { - try - { - Interlocked.Increment(ref _beforeAllTestsInClassExecutionCount); - var builder = WebApplication.CreateBuilder(); - _app = builder.Build(); - - _app.MapGet("/ping", context => context.Response.WriteAsync($"Hello {context.Request.Query["testName"]}!")); - - await _app.StartAsync(); - _serverAddress = _app.Services.GetRequiredService() - .Features - .Get()! - .Addresses - .Last(); - } - catch (Exception e) - { - Console.WriteLine(e); - throw new Exception($$""" - Before(Class) Count: {{_beforeAllTestsInClassExecutionCount}} - After(Class) Count: {{_afterAllTestsInClassExecutionCount}} - """, e); - } - } - - [After(Class)] - public static async Task StopServer() - { - Interlocked.Increment(ref _afterAllTestsInClassExecutionCount); - - await _app.StopAsync(); - await _app.DisposeAsync(); - } - - [Before(Test)] - public async Task Setup() - { - _response = await new HttpClient().GetAsync($"{_serverAddress}/ping/?testName={TestContext.Current?.TestDetails.TestName}"); - } - - [After(Test)] - public void Dispose() - { - _response?.Dispose(); - } - - [Test] - public async Task TestServerResponse1() - { - await Assert.That(_response?.StatusCode).IsNotNull().And.IsEquatableOrEqualTo(HttpStatusCode.OK); - - await Assert.That(await _response!.Content.ReadAsStringAsync()) - .IsEqualTo("Hello TestServerResponse1!"); - } - - [Test] - public async Task TestServerResponse2() - { - await Assert.That(_response?.StatusCode).IsNotNull() - .And.IsEquatableOrEqualTo(HttpStatusCode.OK); - - await Assert.That(await _response!.Content.ReadAsStringAsync()) - .IsEqualTo("Hello TestServerResponse2!"); - } -} \ No newline at end of file diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index 3a653c2f86..0ebc1e3310 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -36,6 +36,7 @@ + From cc93da47542fab6d9843679aa01b0753f4f99ffd Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 01:01:42 +0000 Subject: [PATCH 31/71] Fix --- TUnit.TestProject/CustomClassDisplayNameTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/TUnit.TestProject/CustomClassDisplayNameTests.cs b/TUnit.TestProject/CustomClassDisplayNameTests.cs index 7ee4c156d1..63ea7de3af 100644 --- a/TUnit.TestProject/CustomClassDisplayNameTests.cs +++ b/TUnit.TestProject/CustomClassDisplayNameTests.cs @@ -1,6 +1,7 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; using TUnit.Core.Extensions; +using TUnit.TestProject.AfterTests; #pragma warning disable CS9113 // Parameter is unread. From 1aa3047daeac0d440c2d4c16e5069bd5a04c834b Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 01:04:15 +0000 Subject: [PATCH 32/71] Fix --- TUnit.TestProject/TUnit.TestProject.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index 0ebc1e3310..d777a7de4a 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -39,7 +39,6 @@ - From 51416e989ee06776c61c7fe7ed7e3301241239b4 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 01:16:07 +0000 Subject: [PATCH 33/71] Fixes --- Directory.Build.props | 9 --------- Directory.Build.targets | 2 +- TUnit.Engine/TUnit.Engine.csproj | 3 ++- TUnit.UnitTests/TUnit.UnitTests.csproj | 1 + 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b1f6a76072..54bd0e5e57 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,17 +29,8 @@ - - <_Parameter1>TUnit.Core - - - <_Parameter1>TUnit.Assertions - <_Parameter1>TUnit.Engine - - - <_Parameter1>TUnit <_Parameter1>TUnit.UnitTests diff --git a/Directory.Build.targets b/Directory.Build.targets index 611dc5b16c..0390ffe068 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,5 @@ - + netstandard2.0;net8.0;net9.0 diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index d2be7c71e3..b4dec4b2eb 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -1,5 +1,6 @@  + false true false false @@ -9,7 +10,7 @@ LAUNCH_DEBUGGER - + diff --git a/TUnit.UnitTests/TUnit.UnitTests.csproj b/TUnit.UnitTests/TUnit.UnitTests.csproj index 31567bb635..b80d1df440 100644 --- a/TUnit.UnitTests/TUnit.UnitTests.csproj +++ b/TUnit.UnitTests/TUnit.UnitTests.csproj @@ -1,6 +1,7 @@ + false true enable enable From cf70b833f393d1a777da19101babb0acf1d85273 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 09:37:57 +0000 Subject: [PATCH 34/71] Tidy --- Directory.Build.targets | 4 +++- Polyfill.props | 5 ++++- TUnit.TestProject/AfterTestAttributeTests.cs | 3 +++ TUnit.TestProject/Bugs/1304/Tests.cs | 2 -- TUnit.TestProject/CustomDisplayNameTests.cs | 2 ++ TUnit.TestProject/DependencyInjectionClassConstructor.cs | 2 ++ TUnit.TestProject/DisposableFieldTests.cs | 4 +++- TUnit.TestProject/DynamicallyRegisteredTests.cs | 2 ++ TUnit.TestProject/ExampleTestFixture.cs | 2 ++ TUnit.TestProject/FilterByDynamicAddedPropertyTests.cs | 2 ++ TUnit.TestProject/GenericTests.cs | 4 +++- TUnit.TestProject/SomethingElseAttribute.cs | 2 ++ 12 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 0390ffe068..8733e38cb3 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,7 @@ - + netstandard2.0;net8.0;net9.0 diff --git a/Polyfill.props b/Polyfill.props index 4600be3045..59fe854cf9 100644 --- a/Polyfill.props +++ b/Polyfill.props @@ -1,6 +1,9 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/TUnit.TestProject/AfterTestAttributeTests.cs b/TUnit.TestProject/AfterTestAttributeTests.cs index 77ea129063..ef35566a62 100644 --- a/TUnit.TestProject/AfterTestAttributeTests.cs +++ b/TUnit.TestProject/AfterTestAttributeTests.cs @@ -20,7 +20,10 @@ public class WriteFileAfterTestAttribute : Attribute, ITestEndEventReceiver public async ValueTask OnTestEnd(TestContext testContext) { Console.WriteLine(@"Writing file inside WriteFileAfterTestAttribute!"); + await File.WriteAllTextAsync(Filename, "Foo!"); } + + public int Order => 0; } } \ No newline at end of file diff --git a/TUnit.TestProject/Bugs/1304/Tests.cs b/TUnit.TestProject/Bugs/1304/Tests.cs index eac771e992..51b4e54b97 100644 --- a/TUnit.TestProject/Bugs/1304/Tests.cs +++ b/TUnit.TestProject/Bugs/1304/Tests.cs @@ -67,6 +67,4 @@ public async Task TryParse_ValidString_ReturnsAccountId(string input) public interface IIdentifiable { bool HasValue { get; } - static abstract TId Empty { get; } - static abstract TId New { get; } } \ No newline at end of file diff --git a/TUnit.TestProject/CustomDisplayNameTests.cs b/TUnit.TestProject/CustomDisplayNameTests.cs index 1dbc906a7a..2d6aec9ece 100644 --- a/TUnit.TestProject/CustomDisplayNameTests.cs +++ b/TUnit.TestProject/CustomDisplayNameTests.cs @@ -60,4 +60,6 @@ public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) } public static string Method() => "bar"; + + public int Order => 0; } \ No newline at end of file diff --git a/TUnit.TestProject/DependencyInjectionClassConstructor.cs b/TUnit.TestProject/DependencyInjectionClassConstructor.cs index 5f3620cd7a..a3473383fc 100644 --- a/TUnit.TestProject/DependencyInjectionClassConstructor.cs +++ b/TUnit.TestProject/DependencyInjectionClassConstructor.cs @@ -27,4 +27,6 @@ private static IServiceProvider CreateServiceProvider() .AddTransient() .BuildServiceProvider(); } + + public int Order => 0; } \ No newline at end of file diff --git a/TUnit.TestProject/DisposableFieldTests.cs b/TUnit.TestProject/DisposableFieldTests.cs index 201a2dcac7..88d1816587 100644 --- a/TUnit.TestProject/DisposableFieldTests.cs +++ b/TUnit.TestProject/DisposableFieldTests.cs @@ -1,4 +1,6 @@ -namespace TUnit.TestProject; +using System.Net.Http; + +namespace TUnit.TestProject; public class DisposableFieldTests { diff --git a/TUnit.TestProject/DynamicallyRegisteredTests.cs b/TUnit.TestProject/DynamicallyRegisteredTests.cs index 66850138a7..432154b280 100644 --- a/TUnit.TestProject/DynamicallyRegisteredTests.cs +++ b/TUnit.TestProject/DynamicallyRegisteredTests.cs @@ -67,4 +67,6 @@ private static bool IsReregisteredTest(TestContext testContext) { return testContext.ObjectBag.ContainsKey("DynamicDataGeneratorRetry"); } + + public int Order => 0; } \ No newline at end of file diff --git a/TUnit.TestProject/ExampleTestFixture.cs b/TUnit.TestProject/ExampleTestFixture.cs index ca2e9a400b..e4e32dadbe 100644 --- a/TUnit.TestProject/ExampleTestFixture.cs +++ b/TUnit.TestProject/ExampleTestFixture.cs @@ -49,4 +49,6 @@ private static IServiceProvider CreateServiceProvider() //.AddScoped() //Commenting this line out removes the test from the discovery .BuildServiceProvider(); } + + public int Order => 0; } \ No newline at end of file diff --git a/TUnit.TestProject/FilterByDynamicAddedPropertyTests.cs b/TUnit.TestProject/FilterByDynamicAddedPropertyTests.cs index 5081483260..3557820109 100644 --- a/TUnit.TestProject/FilterByDynamicAddedPropertyTests.cs +++ b/TUnit.TestProject/FilterByDynamicAddedPropertyTests.cs @@ -16,5 +16,7 @@ public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) { discoveredTestContext.AddProperty("MyKey", "MyDynamicallyAddedValue"); } + + public int Order => 0; } } \ No newline at end of file diff --git a/TUnit.TestProject/GenericTests.cs b/TUnit.TestProject/GenericTests.cs index 81895d39ec..5797f2a0f7 100644 --- a/TUnit.TestProject/GenericTests.cs +++ b/TUnit.TestProject/GenericTests.cs @@ -1,4 +1,6 @@ -using System.Numerics; +#if NET + +using System.Numerics; using TUnit.Assertions; using TUnit.Assertions.Extensions; diff --git a/TUnit.TestProject/SomethingElseAttribute.cs b/TUnit.TestProject/SomethingElseAttribute.cs index 53a6331371..c04cf7bba1 100644 --- a/TUnit.TestProject/SomethingElseAttribute.cs +++ b/TUnit.TestProject/SomethingElseAttribute.cs @@ -8,4 +8,6 @@ public ValueTask OnTestStart(BeforeTestContext beforeTestContext) { return ValueTask.CompletedTask; } + + public int Order => 0; } \ No newline at end of file From 33be67490ece3f6a248885cb2d4998b23d021023 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 21 Dec 2024 10:00:18 +0000 Subject: [PATCH 35/71] WIP --- TUnit.TestProject/BasicTests.cs | 2 +- TUnit.TestProject/CustomDisplayNameTests.cs | 2 ++ TUnit.TestProject/DisposablePropertyTests.cs | 4 +++- TUnit.TestProject/Dummy/SomeAsyncDisposableClass.cs | 2 +- TUnit.TestProject/DynamicallyRegisteredTests.cs | 10 +++++++--- TUnit.TestProject/GenericTests.cs | 3 ++- TUnit.TestProject/ReturnTypeTests.cs | 4 ++-- TUnit.TestProject/SomethingElseAttribute.cs | 8 ++++++-- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/TUnit.TestProject/BasicTests.cs b/TUnit.TestProject/BasicTests.cs index 6557ecac7d..6d762a1a0b 100644 --- a/TUnit.TestProject/BasicTests.cs +++ b/TUnit.TestProject/BasicTests.cs @@ -17,6 +17,6 @@ public async Task AsynchronousTest() [Test] public async ValueTask ValueTaskAsynchronousTest() { - await ValueTask.CompletedTask; + await default; } } \ No newline at end of file diff --git a/TUnit.TestProject/CustomDisplayNameTests.cs b/TUnit.TestProject/CustomDisplayNameTests.cs index 2d6aec9ece..b294e2eb49 100644 --- a/TUnit.TestProject/CustomDisplayNameTests.cs +++ b/TUnit.TestProject/CustomDisplayNameTests.cs @@ -57,6 +57,8 @@ public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) { discoveredTestContext.SetDisplayName($"{discoveredTestContext.TestDetails.TestName}(REDACTED)"); } + + public int Order => 0; } public static string Method() => "bar"; diff --git a/TUnit.TestProject/DisposablePropertyTests.cs b/TUnit.TestProject/DisposablePropertyTests.cs index b561be01b3..3503807bde 100644 --- a/TUnit.TestProject/DisposablePropertyTests.cs +++ b/TUnit.TestProject/DisposablePropertyTests.cs @@ -1,4 +1,6 @@ -namespace TUnit.TestProject; +using System.Net.Http; + +namespace TUnit.TestProject; public class DisposablePropertyTests { diff --git a/TUnit.TestProject/Dummy/SomeAsyncDisposableClass.cs b/TUnit.TestProject/Dummy/SomeAsyncDisposableClass.cs index 2e7683794e..75b7fa77a0 100644 --- a/TUnit.TestProject/Dummy/SomeAsyncDisposableClass.cs +++ b/TUnit.TestProject/Dummy/SomeAsyncDisposableClass.cs @@ -9,6 +9,6 @@ public class SomeAsyncDisposableClass : IAsyncDisposable public ValueTask DisposeAsync() { IsDisposed = true; - return ValueTask.CompletedTask; + return default; } } \ No newline at end of file diff --git a/TUnit.TestProject/DynamicallyRegisteredTests.cs b/TUnit.TestProject/DynamicallyRegisteredTests.cs index 432154b280..d325ace747 100644 --- a/TUnit.TestProject/DynamicallyRegisteredTests.cs +++ b/TUnit.TestProject/DynamicallyRegisteredTests.cs @@ -23,7 +23,7 @@ public class DynamicDataGenerator : DataSourceGeneratorAttribute, ITestStar public override IEnumerable> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata) { - yield return () => Random.Shared.Next(); + yield return () => new Random().Next(); } public ValueTask OnTestStart(BeforeTestContext beforeTestContext) @@ -33,7 +33,11 @@ public ValueTask OnTestStart(BeforeTestContext beforeTestContext) beforeTestContext.AddLinkedCancellationToken(_cancellationTokenSource.Token); } - return ValueTask.CompletedTask; + return default; + } + + public void OnTestStartSynchronous(BeforeTestContext beforeTestContext) + { } [Experimental("WIP")] @@ -55,7 +59,7 @@ public async ValueTask OnTestEnd(TestContext testContext) // testContext.SuppressReportingResult(); } - await testContext.ReregisterTestWithArguments(methodArguments: [Random.Shared.Next()], + await testContext.ReregisterTestWithArguments(methodArguments: [new Random().Next()], objectBag: new() { ["DynamicDataGeneratorRetry"] = true diff --git a/TUnit.TestProject/GenericTests.cs b/TUnit.TestProject/GenericTests.cs index 5797f2a0f7..affcd37114 100644 --- a/TUnit.TestProject/GenericTests.cs +++ b/TUnit.TestProject/GenericTests.cs @@ -83,4 +83,5 @@ public override IEnumerable GetEnumerableData() yield return 3.4; yield return 4.4; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/TUnit.TestProject/ReturnTypeTests.cs b/TUnit.TestProject/ReturnTypeTests.cs index addefa6167..9b521fc44d 100644 --- a/TUnit.TestProject/ReturnTypeTests.cs +++ b/TUnit.TestProject/ReturnTypeTests.cs @@ -29,12 +29,12 @@ public Task Test4() [Test] public ValueTask Test5() { - return ValueTask.CompletedTask; + return default; } [Test] public ValueTask Test6() { - return ValueTask.FromResult(1); + return new ValueTask(1); } } \ No newline at end of file diff --git a/TUnit.TestProject/SomethingElseAttribute.cs b/TUnit.TestProject/SomethingElseAttribute.cs index c04cf7bba1..81717bc28a 100644 --- a/TUnit.TestProject/SomethingElseAttribute.cs +++ b/TUnit.TestProject/SomethingElseAttribute.cs @@ -6,8 +6,12 @@ public class SomethingElseAttribute : Attribute, ITestStartEventReceiver { public ValueTask OnTestStart(BeforeTestContext beforeTestContext) { - return ValueTask.CompletedTask; + return default; } - + + public void OnTestStartSynchronous(BeforeTestContext beforeTestContext) + { + } + public int Order => 0; } \ No newline at end of file From 212a036b3ef508411de2fa390c35094f000949a0 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:50:50 +0000 Subject: [PATCH 36/71] Compilation fixes --- TUnit.TestProject/AfterTestAttributeTests.cs | 3 +- .../AfterTests/TestDiscoveryAfterTests.cs | 3 +- .../AfterTests/TestSessionAfterTests.cs | 3 +- TUnit.TestProject/AssemblyHooks.cs | 15 ++++++-- .../AsyncDisposableFieldTests.cs | 7 +++- TUnit.TestProject/BasicTests.cs | 2 +- .../BeforeTests/TestDiscoveryBeforeTests.cs | 6 ++- .../BeforeTests/TestSessionBeforeTests.cs | 3 +- TUnit.TestProject/Polyfills/FilePolyfill.cs | 38 +++++++++++++++++++ TUnit.TestProject/PropertySetterTests.cs | 9 +++-- 10 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 TUnit.TestProject/Polyfills/FilePolyfill.cs diff --git a/TUnit.TestProject/AfterTestAttributeTests.cs b/TUnit.TestProject/AfterTestAttributeTests.cs index ef35566a62..b03935951e 100644 --- a/TUnit.TestProject/AfterTestAttributeTests.cs +++ b/TUnit.TestProject/AfterTestAttributeTests.cs @@ -1,6 +1,7 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; using TUnit.Core.Interfaces; +using TUnit.TestProject.Polyfills; namespace TUnit.TestProject; @@ -21,7 +22,7 @@ public async ValueTask OnTestEnd(TestContext testContext) { Console.WriteLine(@"Writing file inside WriteFileAfterTestAttribute!"); - await File.WriteAllTextAsync(Filename, "Foo!"); + await FilePolyfill.WriteAllTextAsync(Filename, "Foo!"); } public int Order => 0; diff --git a/TUnit.TestProject/AfterTests/TestDiscoveryAfterTests.cs b/TUnit.TestProject/AfterTests/TestDiscoveryAfterTests.cs index 44a03d54c9..851574cf48 100644 --- a/TUnit.TestProject/AfterTests/TestDiscoveryAfterTests.cs +++ b/TUnit.TestProject/AfterTests/TestDiscoveryAfterTests.cs @@ -1,5 +1,6 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; +using TUnit.TestProject.Polyfills; namespace TUnit.TestProject.AfterTests; @@ -14,7 +15,7 @@ public static async Task AfterTestDiscovery(TestDiscoveryContext context) [AfterEvery(TestDiscovery)] public static async Task AfterEveryTestDiscovery(TestDiscoveryContext context) { - await File.WriteAllTextAsync($"TestDiscoveryAfterTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests found"); + await FilePolyfill.WriteAllTextAsync($"TestDiscoveryAfterTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests found"); var test = context.AllTests.First(x => x.TestDetails.TestName == nameof(TestDiscoveryAfterTests.EnsureAfterEveryTestDiscoveryHit)); diff --git a/TUnit.TestProject/AfterTests/TestSessionAfterTests.cs b/TUnit.TestProject/AfterTests/TestSessionAfterTests.cs index 7ec1abebb1..88fc2dceb6 100644 --- a/TUnit.TestProject/AfterTests/TestSessionAfterTests.cs +++ b/TUnit.TestProject/AfterTests/TestSessionAfterTests.cs @@ -1,5 +1,6 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; +using TUnit.TestProject.Polyfills; namespace TUnit.TestProject.AfterTests; @@ -14,7 +15,7 @@ public static async Task AfterTestSession(TestSessionContext context) [AfterEvery(TestSession)] public static async Task AfterEveryTestSession(TestSessionContext context) { - await File.WriteAllTextAsync($"TestSessionAfterTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests in session"); + await FilePolyfill.WriteAllTextAsync($"TestSessionAfterTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests in session"); var test = context.AllTests.FirstOrDefault(x => x.TestDetails.TestName == nameof(TestSessionAfterTests.PepareForAfterSession)); diff --git a/TUnit.TestProject/AssemblyHooks.cs b/TUnit.TestProject/AssemblyHooks.cs index fb7633002e..cdcc737102 100644 --- a/TUnit.TestProject/AssemblyHooks.cs +++ b/TUnit.TestProject/AssemblyHooks.cs @@ -13,45 +13,54 @@ public static void BeforeHook1() _beforeHook1Calls++; } + +#if NET [Before(Assembly)] public static async Task BeforeHook2(AssemblyHookContext context) { await Assert.That(context.TestCount).IsPositive(); } +#endif [Before(Assembly), Timeout(30_000)] public static void BeforeHook3(CancellationToken cancellationToken) { // Dummy method } - + +#if NET [Before(Assembly), Timeout(30_000)] public static async Task BeforeHook4(AssemblyHookContext context, CancellationToken cancellationToken) { await Assert.That(context.TestCount).IsPositive(); } +#endif [After(Assembly)] public static async Task AfterHook1() { await Assert.That(_beforeHook1Calls).IsEqualTo(1); } - + +#if NET [After(Assembly)] public static async Task AfterHook2(AssemblyHookContext context) { await Assert.That(context.TestCount).IsPositive(); } +#endif [After(Assembly), Timeout(30_000)] public static void AfterHook3(CancellationToken cancellationToken) { // Dummy method } - + +#if NET [After(Assembly), Timeout(30_000)] public static async Task AfterHook4(AssemblyHookContext context, CancellationToken cancellationToken) { await Assert.That(context.TestCount).IsPositive(); } +#endif } \ No newline at end of file diff --git a/TUnit.TestProject/AsyncDisposableFieldTests.cs b/TUnit.TestProject/AsyncDisposableFieldTests.cs index d21cb2672d..9c425c9d6d 100644 --- a/TUnit.TestProject/AsyncDisposableFieldTests.cs +++ b/TUnit.TestProject/AsyncDisposableFieldTests.cs @@ -1,4 +1,6 @@ -namespace TUnit.TestProject; +#if NET + +namespace TUnit.TestProject; public class AsyncDisposableFieldTests { @@ -21,4 +23,5 @@ public void Test1() { // Dummy method } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/TUnit.TestProject/BasicTests.cs b/TUnit.TestProject/BasicTests.cs index 6d762a1a0b..bf795b8fba 100644 --- a/TUnit.TestProject/BasicTests.cs +++ b/TUnit.TestProject/BasicTests.cs @@ -17,6 +17,6 @@ public async Task AsynchronousTest() [Test] public async ValueTask ValueTaskAsynchronousTest() { - await default; + await new ValueTask(); } } \ No newline at end of file diff --git a/TUnit.TestProject/BeforeTests/TestDiscoveryBeforeTests.cs b/TUnit.TestProject/BeforeTests/TestDiscoveryBeforeTests.cs index b6db49496c..ab4d330c15 100644 --- a/TUnit.TestProject/BeforeTests/TestDiscoveryBeforeTests.cs +++ b/TUnit.TestProject/BeforeTests/TestDiscoveryBeforeTests.cs @@ -1,4 +1,6 @@ -namespace TUnit.TestProject.BeforeTests; +using TUnit.TestProject.Polyfills; + +namespace TUnit.TestProject.BeforeTests; public class TestDiscoveryBeforeHooks { @@ -11,7 +13,7 @@ public static async Task BeforeTestDiscovery(BeforeTestDiscoveryContext context) [BeforeEvery(TestDiscovery)] public static async Task BeforeEveryTestDiscovery(BeforeTestDiscoveryContext context) { - await File.WriteAllTextAsync($"TestDiscoveryBeforeTests{Guid.NewGuid():N}.txt", $"Blah!"); + await FilePolyfill.WriteAllTextAsync($"TestDiscoveryBeforeTests{Guid.NewGuid():N}.txt", $"Blah!"); } } diff --git a/TUnit.TestProject/BeforeTests/TestSessionBeforeTests.cs b/TUnit.TestProject/BeforeTests/TestSessionBeforeTests.cs index aeca8d68b5..c9f9ee9a3c 100644 --- a/TUnit.TestProject/BeforeTests/TestSessionBeforeTests.cs +++ b/TUnit.TestProject/BeforeTests/TestSessionBeforeTests.cs @@ -1,5 +1,6 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; +using TUnit.TestProject.Polyfills; namespace TUnit.TestProject.BeforeTests; @@ -14,7 +15,7 @@ public static async Task BeforeTestSession(TestSessionContext context) [BeforeEvery(TestSession)] public static async Task BeforeEveryTestSession(TestSessionContext context) { - await File.WriteAllTextAsync($"TestSessionBeforeTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests in session"); + await FilePolyfill.WriteAllTextAsync($"TestSessionBeforeTests{Guid.NewGuid():N}.txt", $"{context.AllTests.Count()} tests in session"); var test = context.AllTests.FirstOrDefault(x => x.TestDetails.TestName == nameof(TestSessionBeforeTests.EnsureBeforeEveryTestSessionHit)); diff --git a/TUnit.TestProject/Polyfills/FilePolyfill.cs b/TUnit.TestProject/Polyfills/FilePolyfill.cs new file mode 100644 index 0000000000..7f8fc0553a --- /dev/null +++ b/TUnit.TestProject/Polyfills/FilePolyfill.cs @@ -0,0 +1,38 @@ +using System.Text; + +namespace TUnit.TestProject.Polyfills; + +public class FilePolyfill +{ + public static async Task WriteAllTextAsync(string path, string content) + { + var directory = Path.GetDirectoryName(path); + if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None, 4096, useAsync: true); + + var encodedText = Encoding.UTF8.GetBytes(content); + + await fileStream.WriteAsync(encodedText, 0, encodedText.Length); + } + + public static async Task AppendAllLinesAsync(string path, IEnumerable lines) + { + var directory = Path.GetDirectoryName(path); + if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + using var fileStream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.None, 4096, useAsync: true); + + foreach (var line in lines) + { + var encodedText = Encoding.UTF8.GetBytes(line + Environment.NewLine); + await fileStream.WriteAsync(encodedText, 0, encodedText.Length); + } + } +} \ No newline at end of file diff --git a/TUnit.TestProject/PropertySetterTests.cs b/TUnit.TestProject/PropertySetterTests.cs index c2ba77cf3b..f3ca610100 100644 --- a/TUnit.TestProject/PropertySetterTests.cs +++ b/TUnit.TestProject/PropertySetterTests.cs @@ -1,6 +1,7 @@ using TUnit.Assertions; using TUnit.Assertions.Extensions; using TUnit.Core.Interfaces; +using TUnit.TestProject.Polyfills; namespace TUnit.TestProject; @@ -95,7 +96,7 @@ public async ValueTask DisposeAsync() if (IsMatchingTestFilter()) { - await File.WriteAllTextAsync("Property_IAsyncDisposable.txt", "true"); + await FilePolyfill.WriteAllTextAsync("Property_IAsyncDisposable.txt", "true"); } } } @@ -118,7 +119,7 @@ public async ValueTask DisposeAsync() if (IsMatchingTestFilter()) { - await File.WriteAllTextAsync("StaticProperty_IAsyncDisposable.txt", "true"); + await FilePolyfill.WriteAllTextAsync("StaticProperty_IAsyncDisposable.txt", "true"); } } } @@ -130,13 +131,13 @@ private static async Task PrintMessage(string message) if (GlobalContext.Current.TestFilter is "/*/*/PropertySetterTests/*") { Console.WriteLine(message); - await File.AppendAllLinesAsync("PropertySetterTests_CapturedOutput.txt", [message]); + await FilePolyfill.AppendAllLinesAsync("PropertySetterTests_CapturedOutput.txt", [message]); } if (GlobalContext.Current.TestFilter is "/*/*/InheritedPropertySetterTests/*") { Console.WriteLine(message); - await File.AppendAllLinesAsync("InheritedPropertySetterTests_CapturedOutput.txt", [message]); + await FilePolyfill.AppendAllLinesAsync("InheritedPropertySetterTests_CapturedOutput.txt", [message]); } } From ff85748944416d56299e5e3827943c2f04c12108 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:51:15 +0000 Subject: [PATCH 37/71] Compilation fixes --- TUnit.TestProject/AsyncDisposablePropertyTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.TestProject/AsyncDisposablePropertyTests.cs b/TUnit.TestProject/AsyncDisposablePropertyTests.cs index 56a97615cb..42d31e5759 100644 --- a/TUnit.TestProject/AsyncDisposablePropertyTests.cs +++ b/TUnit.TestProject/AsyncDisposablePropertyTests.cs @@ -13,9 +13,9 @@ public void Setup() } [After(Test)] - public async Task Blah() + public void Blah() { - await TextWriter!.DisposeAsync(); + TextWriter!.Dispose(); } [Test] From d7a41c11f84a3f38606b73d5a23b1c4d517b19d8 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:58:02 +0000 Subject: [PATCH 38/71] Trim on .NET 8 upwards --- Directory.Build.targets | 2 +- TUnit.TestProject/Bugs/1304/Tests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 8733e38cb3..9babc689c3 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -17,7 +17,7 @@ $(DefineConstants);ROSLYN4_7_OR_GREATER - true + true diff --git a/TUnit.TestProject/Bugs/1304/Tests.cs b/TUnit.TestProject/Bugs/1304/Tests.cs index 51b4e54b97..b96b7821b4 100644 --- a/TUnit.TestProject/Bugs/1304/Tests.cs +++ b/TUnit.TestProject/Bugs/1304/Tests.cs @@ -15,7 +15,7 @@ public class Tests public async Task TryParse_InvalidString_ReturnsFailure(string? input, CancellationToken cancellationToken) { // Act - var success = AccountId.TryParse(input, out var id); + var success = AccountId.TryParse(input!, out var id); // Assert await Assert.That(success).IsFalse(); From 37e7631bc0416954c79089eeaead01b92282e69c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:05:55 +0000 Subject: [PATCH 39/71] Fix --- TUnit.Assertions/StringUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.Assertions/StringUtils.cs b/TUnit.Assertions/StringUtils.cs index cf941f98bb..85297a5dcc 100644 --- a/TUnit.Assertions/StringUtils.cs +++ b/TUnit.Assertions/StringUtils.cs @@ -33,12 +33,12 @@ public static string FindClosestSubstring(string? text, string? pattern, if (ignoreWhitespace) { - foreach (var (key, value) in actualDictionary.Where(x => char.IsWhiteSpace(x.Value))) + foreach (var (key, value) in actualDictionary.ToList().Where(x => char.IsWhiteSpace(x.Value))) { actualDictionary.Remove(key); } - foreach (var (key, value) in expectedDictionary.Where(x => char.IsWhiteSpace(x.Value))) + foreach (var (key, value) in expectedDictionary.ToList().Where(x => char.IsWhiteSpace(x.Value))) { expectedDictionary.Remove(key); } From d479fc037d3d6e5038346ce43c97d602f19d3eca Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:10:01 +0000 Subject: [PATCH 40/71] Fixes --- TUnit.TestProject/TUnit.TestProject.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.TestProject/TUnit.TestProject.csproj b/TUnit.TestProject/TUnit.TestProject.csproj index d777a7de4a..7370bf5049 100644 --- a/TUnit.TestProject/TUnit.TestProject.csproj +++ b/TUnit.TestProject/TUnit.TestProject.csproj @@ -14,13 +14,13 @@ false - + true true true - + true true true From dce56d53d8f38ba6b78dfdc21f310a3475ab7b0f Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:24:45 +0000 Subject: [PATCH 41/71] Skip --- TUnit.Pipeline/Modules/PublishAOTModule.cs | 7 ++++++- TUnit.Pipeline/Modules/PublishSingleFileModule.cs | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TUnit.Pipeline/Modules/PublishAOTModule.cs b/TUnit.Pipeline/Modules/PublishAOTModule.cs index 36010b5623..d589b2cbfb 100644 --- a/TUnit.Pipeline/Modules/PublishAOTModule.cs +++ b/TUnit.Pipeline/Modules/PublishAOTModule.cs @@ -12,7 +12,12 @@ namespace TUnit.Pipeline.Modules; public class PublishAOTModule : Module { public override ModuleRunType ModuleRunType => ModuleRunType.AlwaysRun; - + + protected override Task ShouldSkip(IPipelineContext context) + { + return Task.FromResult(Environment.GetEnvironmentVariable("NET_VERSION") == "net472"); + } + protected override async Task ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken) { var testProject = context.Git().RootDirectory!.FindFile(x => x.Name == "TUnit.TestProject.csproj").AssertExists(); diff --git a/TUnit.Pipeline/Modules/PublishSingleFileModule.cs b/TUnit.Pipeline/Modules/PublishSingleFileModule.cs index d0734cbdef..ac3a4d0025 100644 --- a/TUnit.Pipeline/Modules/PublishSingleFileModule.cs +++ b/TUnit.Pipeline/Modules/PublishSingleFileModule.cs @@ -15,6 +15,11 @@ public class PublishSingleFileModule : Module { public override ModuleRunType ModuleRunType => ModuleRunType.AlwaysRun; + protected override Task ShouldSkip(IPipelineContext context) + { + return Task.FromResult(Environment.GetEnvironmentVariable("NET_VERSION") == "net472"); + } + protected override async Task ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken) { var testProject = context.Git().RootDirectory!.FindFile(x => x.Name == "TUnit.TestProject.csproj").AssertExists(); From 29b7605b653efe16d659decc2132ae63970d4d04 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:36:01 +0000 Subject: [PATCH 42/71] Environment.GetEnvironmentVariable("NET_VERSION") --- .github/workflows/dotnet-framework.yml | 2 +- TUnit.Engine.Tests/InvokableTestBase.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml index ab952176aa..91d971fee9 100644 --- a/.github/workflows/dotnet-framework.yml +++ b/.github/workflows/dotnet-framework.yml @@ -24,7 +24,7 @@ jobs: - name: Setup .NET Framework uses: microsoft/setup-msbuild@v2 - - name: Build .NET 472 + - name: Build run: dotnet build -c Release -p:TreatWarningsAsErrors=true - name: Run Pipeline diff --git a/TUnit.Engine.Tests/InvokableTestBase.cs b/TUnit.Engine.Tests/InvokableTestBase.cs index 4e9e2f1d5f..f5404e65ba 100644 --- a/TUnit.Engine.Tests/InvokableTestBase.cs +++ b/TUnit.Engine.Tests/InvokableTestBase.cs @@ -21,6 +21,11 @@ protected async Task RunTestsWithFilter(string filter, { await RunWithoutAot(filter, assertions, runOptions, assertionExpression); + if (Environment.GetEnvironmentVariable("NET_VERSION") == "net472") + { + return; + } + await RunWithAot(filter, assertions, runOptions, assertionExpression); await RunWithSingleFile(filter, assertions, runOptions, assertionExpression); @@ -36,7 +41,7 @@ private async Task RunWithoutAot(string filter, [ "run", "--no-build", - "-f", "net9.0", + "-f", Environment.GetEnvironmentVariable("NET_VERSION")!, "--configuration", "Release", "--treenode-filter", filter, "--report-trx", "--report-trx-filename", trxFilename, From bba0f765326914a7f4ec20bfb9844a7e4925e408 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 18:33:12 +0000 Subject: [PATCH 43/71] Fixes --- TUnit.Core/Logging/DefaultLogger.cs | 2 +- TUnit.Core/Logging/ILogger.cs | 2 +- TUnit.Core/Logging/LoggingExtensions.cs | 16 +++++----- TUnit.Core/Logging/NullLogger.cs | 4 +-- TUnit.Core/Logging/TUnitLogger.cs | 2 +- .../Framework/TUnitServiceProvider.cs | 4 +-- TUnit.Engine/Framework/TUnitTestFramework.cs | 16 ++++++++-- TUnit.Engine/Logging/MTPLoggerAdapter.cs | 4 +-- TUnit.Engine/Logging/TUnitFrameworkLogger.cs | 12 ++++++- TUnit.Engine/Services/SingleTestExecutor.cs | 25 +++++++++++++++ TUnit.Engine/Services/TUnitTestDiscoverer.cs | 17 +++++++--- TUnit.Engine/Services/TestInvoker.cs | 21 +++++++++++-- TUnit.Engine/Services/TestsExecutor.cs | 31 +++++++------------ 13 files changed, 108 insertions(+), 48 deletions(-) diff --git a/TUnit.Core/Logging/DefaultLogger.cs b/TUnit.Core/Logging/DefaultLogger.cs index b171ee6c06..d763e1c526 100644 --- a/TUnit.Core/Logging/DefaultLogger.cs +++ b/TUnit.Core/Logging/DefaultLogger.cs @@ -41,7 +41,7 @@ private static string FormatValue(object? value) } - public override async Task LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) + public override async ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) { var message = GenerateMessage(formatter(state, exception), exception, logLevel); diff --git a/TUnit.Core/Logging/ILogger.cs b/TUnit.Core/Logging/ILogger.cs index ee37e59ff9..33ee7f66cb 100644 --- a/TUnit.Core/Logging/ILogger.cs +++ b/TUnit.Core/Logging/ILogger.cs @@ -11,7 +11,7 @@ public interface ILogger /// The exception associated with the message. /// The formatter function to format the message. /// A task representing the asynchronous operation. - Task LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter); + ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter); /// /// Logs a message with the specified log level, state, exception, and formatter. diff --git a/TUnit.Core/Logging/LoggingExtensions.cs b/TUnit.Core/Logging/LoggingExtensions.cs index 98a44f14fb..7a101d442b 100644 --- a/TUnit.Core/Logging/LoggingExtensions.cs +++ b/TUnit.Core/Logging/LoggingExtensions.cs @@ -10,28 +10,28 @@ exception is not null #pragma warning restore RS0030 // Do not use banned APIs : state; - public static Task LogTraceAsync(this ILogger logger, string message) + public static ValueTask LogTraceAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Trace, message, null, Formatter); - public static Task LogDebugAsync(this ILogger logger, string message) + public static ValueTask LogDebugAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Debug, message, null, Formatter); - public static Task LogInformationAsync(this ILogger logger, string message) + public static ValueTask LogInformationAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Information, message, null, Formatter); - public static Task LogWarningAsync(this ILogger logger, string message) + public static ValueTask LogWarningAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Warning, message, null, Formatter); - public static Task LogErrorAsync(this ILogger logger, string message) + public static ValueTask LogErrorAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Error, message, null, Formatter); - public static Task LogErrorAsync(this ILogger logger, string message, Exception ex) + public static ValueTask LogErrorAsync(this ILogger logger, string message, Exception ex) => logger.LogAsync(LogLevel.Error, message, ex, Formatter); - public static Task LogErrorAsync(this ILogger logger, Exception ex) + public static ValueTask LogErrorAsync(this ILogger logger, Exception ex) => logger.LogAsync(LogLevel.Error, ex.ToString(), null, Formatter); - public static Task LogCriticalAsync(this ILogger logger, string message) + public static ValueTask LogCriticalAsync(this ILogger logger, string message) => logger.LogAsync(LogLevel.Critical, message, null, Formatter); public static void LogTrace(this ILogger logger, string message) diff --git a/TUnit.Core/Logging/NullLogger.cs b/TUnit.Core/Logging/NullLogger.cs index 9d5d3c48fb..4cce1b3caf 100644 --- a/TUnit.Core/Logging/NullLogger.cs +++ b/TUnit.Core/Logging/NullLogger.cs @@ -2,10 +2,10 @@ internal class NullLogger : ILogger { - public Task LogAsync(LogLevel logLevel, TState state, Exception? exception, + public ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) { - return Task.CompletedTask; + return default; } public void Log(LogLevel logLevel, TState state, Exception? exception, Func formatter) diff --git a/TUnit.Core/Logging/TUnitLogger.cs b/TUnit.Core/Logging/TUnitLogger.cs index e3a1f048b9..a1b0edc956 100644 --- a/TUnit.Core/Logging/TUnitLogger.cs +++ b/TUnit.Core/Logging/TUnitLogger.cs @@ -2,7 +2,7 @@ public abstract class TUnitLogger : ILogger { - public abstract Task LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter); + public abstract ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter); public abstract void Log(LogLevel logLevel, TState state, Exception? exception, Func formatter); diff --git a/TUnit.Engine/Framework/TUnitServiceProvider.cs b/TUnit.Engine/Framework/TUnitServiceProvider.cs index 58adc97aa9..7107dad7c4 100644 --- a/TUnit.Engine/Framework/TUnitServiceProvider.cs +++ b/TUnit.Engine/Framework/TUnitServiceProvider.cs @@ -88,14 +88,14 @@ public TUnitServiceProvider(IExtension extension, var testHookOrchestrator = Register(new TestHookOrchestrator(hooksCollector)); var testRegistrar = Register(new TestRegistrar(instanceTracker, AssemblyHookOrchestrator, classHookOrchestrator)); - TestDiscoverer = Register(new TUnitTestDiscoverer(hooksCollector, testsLoader, testFilterService, TestGrouper, testRegistrar, TestDiscoveryHookOrchestrator, TUnitMessageBus, LoggerFactory, extension)); + TestDiscoverer = Register(new TUnitTestDiscoverer(hooksCollector, testsLoader, testFilterService, TestGrouper, testRegistrar, TestDiscoveryHookOrchestrator, TUnitMessageBus, Logger, extension)); TestFinder = Register(new TestsFinder(TestDiscoverer)); Register(TestFinder); Disposer = Register(new Disposer(Logger)); - var testInvoker = Register(new TestInvoker(testHookOrchestrator, Disposer)); + var testInvoker = Register(new TestInvoker(testHookOrchestrator, Logger, Disposer)); var explicitFilterService = Register(new ExplicitFilterService()); var parallelLimitProvider = Register(new ParallelLimitLockProvider()); diff --git a/TUnit.Engine/Framework/TUnitTestFramework.cs b/TUnit.Engine/Framework/TUnitTestFramework.cs index 1d5cdd4515..0153f42c2d 100644 --- a/TUnit.Engine/Framework/TUnitTestFramework.cs +++ b/TUnit.Engine/Framework/TUnitTestFramework.cs @@ -52,10 +52,12 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) var stringFilter = serviceProvider.FilterParser.GetTestFilter(context); + var logger = serviceProvider.Logger; + GlobalContext.Current = new GlobalContext { TestFilter = stringFilter, - GlobalLogger = serviceProvider.Logger + GlobalLogger = logger }; serviceProvider.StandardOutConsoleInterceptor.Initialize(); @@ -94,10 +96,14 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) { if(beforeSessionHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [Before(TestSession)] hook"); + beforeSessionHook.Execute(testSessionContext, context.CancellationToken); } else { + await logger.LogDebugAsync("Executing asynchronous [Before(TestSession)] hook"); + await beforeSessionHook.ExecuteAsync(testSessionContext, context.CancellationToken); } } @@ -114,10 +120,14 @@ await serviceProvider.TestsExecutor.ExecuteAsync(filteredTests, runTestExecution { if(afterSessionHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [After(TestSession)] hook"); + afterSessionHook.Execute(testSessionContext, context.CancellationToken); } else { + await logger.LogDebugAsync("Executing asynchronous [After(TestSession)] hook"); + await afterSessionHook.ExecuteAsync(testSessionContext, context.CancellationToken); } } @@ -135,11 +145,11 @@ await serviceProvider.TestsExecutor.ExecuteAsync(filteredTests, runTestExecution catch (Exception e) when (e is TaskCanceledException or OperationCanceledException && context.CancellationToken.IsCancellationRequested) { - await serviceProvider.Logger.LogErrorAsync("The test run was cancelled."); + await logger.LogErrorAsync("The test run was cancelled."); } catch (Exception e) { - await serviceProvider.Logger.LogErrorAsync(e); + await logger.LogErrorAsync(e); await context.MessageBus.PublishAsync( dataProducer: this, diff --git a/TUnit.Engine/Logging/MTPLoggerAdapter.cs b/TUnit.Engine/Logging/MTPLoggerAdapter.cs index a9f4c02d4a..bec07b2f78 100644 --- a/TUnit.Engine/Logging/MTPLoggerAdapter.cs +++ b/TUnit.Engine/Logging/MTPLoggerAdapter.cs @@ -4,9 +4,9 @@ namespace TUnit.Engine.Logging; internal class MTPLoggerAdapter(global::Microsoft.Testing.Platform.Logging.ILogger logger) : ILogger { - public Task LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) + public async ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) { - return logger.LogAsync(Map(logLevel), state, exception, formatter); + await logger.LogAsync(Map(logLevel), state, exception, formatter); } public void Log(LogLevel logLevel, TState state, Exception? exception, Func formatter) diff --git a/TUnit.Engine/Logging/TUnitFrameworkLogger.cs b/TUnit.Engine/Logging/TUnitFrameworkLogger.cs index e8040da148..0f062d1b58 100644 --- a/TUnit.Engine/Logging/TUnitFrameworkLogger.cs +++ b/TUnit.Engine/Logging/TUnitFrameworkLogger.cs @@ -19,8 +19,13 @@ public Task IsEnabledAsync() public string DisplayName => extension.DisplayName; public string Description => extension.Description; - public async Task LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) + public async ValueTask LogAsync(LogLevel logLevel, TState state, Exception? exception, Func formatter) { + if (!IsEnabled(logLevel)) + { + return; + } + var text = formatter(state, exception); await outputDevice.DisplayAsync(this, new FormattedTextOutputDeviceData(text) @@ -43,6 +48,11 @@ public async Task LogAsync(LogLevel logLevel, TState state, Exception? e public void Log(LogLevel logLevel, TState state, Exception? exception, Func formatter) { + if (!IsEnabled(logLevel)) + { + return; + } + var text = formatter(state, exception); outputDevice.DisplayAsync(this, new FormattedTextOutputDeviceData(text) diff --git a/TUnit.Engine/Services/SingleTestExecutor.cs b/TUnit.Engine/Services/SingleTestExecutor.cs index cda1e7b6f1..e4a2eec117 100644 --- a/TUnit.Engine/Services/SingleTestExecutor.cs +++ b/TUnit.Engine/Services/SingleTestExecutor.cs @@ -119,10 +119,14 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF { if (beforeHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [Before(Assembly)] hook"); + beforeHook.Execute(assemblyHookContext, CancellationToken.None); } else { + await logger.LogDebugAsync("Executing asynchronous [Before(Assembly)] hook"); + await beforeHook.ExecuteAsync(assemblyHookContext, CancellationToken.None); } } @@ -158,10 +162,14 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF { if (beforeHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [Before(Class)] hook"); + beforeHook.Execute(classHookContext, CancellationToken.None); } else { + await logger.LogDebugAsync("Executing asynchronous [Before(Class)] hook"); + await beforeHook.ExecuteAsync(classHookContext, CancellationToken.None); } } @@ -180,6 +188,8 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF foreach (var testStartEventsObject in testContext.GetTestStartEventObjects()) { + await logger.LogDebugAsync("Executing ITestStartEventReceivers"); + await testStartEventsObject.OnTestStart(new BeforeTestContext(testContext.InternalDiscoveredTest)); testStartEventsObject.OnTestStartSynchronous(new BeforeTestContext(testContext.InternalDiscoveredTest)); } @@ -198,6 +208,7 @@ private async Task ExecuteTestInternalAsync(DiscoveredTest test, ITestExecutionF } catch (Exception e) { + await logger.LogDebugAsync($"Error in test: {e}"); testContext.SetResult(e); throw; } @@ -247,6 +258,8 @@ private async Task RunCleanUps(DiscoveredTest test, TestContext testContext, { foreach (var testEndEventsObject in testContext.GetTestEndEventObjects()) { + await logger.LogDebugAsync("Executing ITestEndEventReceivers"); + await RunHelpers.RunValueTaskSafelyAsync(() => testEndEventsObject.OnTestEnd(testContext), cleanUpExceptions); } @@ -255,6 +268,8 @@ await RunHelpers.RunValueTaskSafelyAsync(() => testEndEventsObject.OnTestEnd(tes { foreach (var testSkippedEventReceiver in testContext.GetTestSkippedEventObjects()) { + await logger.LogDebugAsync("Executing ITestSkippedEventReceivers"); + await RunHelpers.RunValueTaskSafelyAsync(() => testSkippedEventReceiver.OnTestSkipped(testContext), cleanUpExceptions); } @@ -290,10 +305,14 @@ private async Task ExecuteStaticAfterHooks(DiscoveredTest test, TestContext test { if(afterHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [After(Class)] hook"); + RunHelpers.RunSafely(() => afterHook.Execute(classHookContext, CancellationToken.None), cleanUpExceptions); } else { + await logger.LogDebugAsync("Executing asynchronous [After(Class)] hook"); + await RunHelpers.RunSafelyAsync(() => afterHook.ExecuteAsync(classHookContext, CancellationToken.None), cleanUpExceptions); } } @@ -309,10 +328,14 @@ private async Task ExecuteStaticAfterHooks(DiscoveredTest test, TestContext test { if(afterHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [After(Assembly)] hook"); + RunHelpers.RunSafely(() => afterHook.Execute(assemblyHookContext, CancellationToken.None), cleanUpExceptions); } else { + await logger.LogDebugAsync("Executing asynchronous [After(Assembly)] hook"); + await RunHelpers.RunSafelyAsync(() => afterHook.ExecuteAsync(assemblyHookContext, CancellationToken.None), cleanUpExceptions); } } @@ -325,6 +348,8 @@ private async Task ExecuteStaticAfterHooks(DiscoveredTest test, TestContext test var allTests = testSessionContext.AllTests; foreach (var testEndEventsObject in allTests.SelectMany(tc => tc.GetLastTestInTestSessionEventObjects())) { + await logger.LogDebugAsync("Executing ILastTestInTestSessionEventReceivers"); + await RunHelpers.RunValueTaskSafelyAsync( () => testEndEventsObject.OnLastTestInTestSession(testSessionContext, testContext), cleanUpExceptions); diff --git a/TUnit.Engine/Services/TUnitTestDiscoverer.cs b/TUnit.Engine/Services/TUnitTestDiscoverer.cs index 25bc8f257b..0ec8f8ee40 100644 --- a/TUnit.Engine/Services/TUnitTestDiscoverer.cs +++ b/TUnit.Engine/Services/TUnitTestDiscoverer.cs @@ -1,10 +1,11 @@ using Microsoft.Testing.Platform.Extensions; using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Extensions.TestFramework; -using Microsoft.Testing.Platform.Logging; using Microsoft.Testing.Platform.Requests; using TUnit.Core; +using TUnit.Core.Logging; using TUnit.Engine.Hooks; +using TUnit.Engine.Logging; using TUnit.Engine.Models; namespace TUnit.Engine.Services; @@ -17,11 +18,9 @@ internal class TUnitTestDiscoverer( TestRegistrar testRegistrar, TestDiscoveryHookOrchestrator testDiscoveryHookOrchestrator, ITUnitMessageBus tUnitMessageBus, - ILoggerFactory loggerFactory, + TUnitFrameworkLogger logger, IExtension extension) : IDataProducer { - private readonly ILogger _logger = loggerFactory.CreateLogger(); - private IReadOnlyCollection? _cachedTests; public IReadOnlyCollection GetCachedTests() @@ -39,7 +38,7 @@ public async Task FilterTests(ExecuteRequestContext context, strin var filteredTests = testFilterService.FilterTests(executionRequest?.Filter, allDiscoveredTests).ToArray(); - await _logger.LogTraceAsync($"Found {filteredTests.Length} tests after filtering."); + await logger.LogTraceAsync($"Found {filteredTests.Length} tests after filtering."); var organisedTests = testGrouper.OrganiseTests(filteredTests); @@ -72,10 +71,14 @@ private async Task> DiscoverTests() { if(beforeDiscoveryHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [Before(TestDiscovery)] hook"); + beforeDiscoveryHook.Execute(beforeContext, CancellationToken.None); } else { + await logger.LogDebugAsync("Executing asynchronous [Before(TestDiscovery)] hook"); + await beforeDiscoveryHook.ExecuteAsync(beforeContext, CancellationToken.None); } } @@ -89,10 +92,14 @@ private async Task> DiscoverTests() { if(afterDiscoveryHook.IsSynchronous) { + await logger.LogDebugAsync("Executing asynchronous [After(TestDiscovery)] hook"); + afterDiscoveryHook.Execute(afterContext, CancellationToken.None); } else { + await logger.LogDebugAsync("Executing asynchronous [After(TestDiscovery)] hook"); + await afterDiscoveryHook.ExecuteAsync(afterContext, CancellationToken.None); } } diff --git a/TUnit.Engine/Services/TestInvoker.cs b/TUnit.Engine/Services/TestInvoker.cs index 2444067aa6..d5ee322067 100644 --- a/TUnit.Engine/Services/TestInvoker.cs +++ b/TUnit.Engine/Services/TestInvoker.cs @@ -1,13 +1,16 @@ -using TUnit.Core; +using System.Diagnostics; +using TUnit.Core; using TUnit.Core.Helpers; using TUnit.Core.Interfaces; +using TUnit.Core.Logging; using TUnit.Engine.Extensions; using TUnit.Engine.Helpers; using TUnit.Engine.Hooks; +using TUnit.Engine.Logging; namespace TUnit.Engine.Services; -internal class TestInvoker(TestHookOrchestrator testHookOrchestrator, Disposer disposer) +internal class TestInvoker(TestHookOrchestrator testHookOrchestrator, TUnitFrameworkLogger logger, Disposer disposer) { private readonly SemaphoreSlim _consoleStandardOutLock = new(1, 1); @@ -17,6 +20,8 @@ public async Task Invoke(DiscoveredTest discoveredTest, CancellationToken cancel { if (discoveredTest.TestDetails.ClassInstance is IAsyncInitializer asyncInitializer) { + await logger.LogDebugAsync("Initializing IAsyncInitializer test class..."); + await asyncInitializer.InitializeAsync(); } @@ -32,18 +37,24 @@ public async Task Invoke(DiscoveredTest discoveredTest, CancellationToken cancel { if (executableHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [Before(Test)] hook"); + Timings.Record($"Before(Test): {executableHook.Name}", discoveredTest.TestContext, () => executableHook.Execute(discoveredTest.TestContext, cancellationToken) ); } else { + await logger.LogDebugAsync("Executing asynchronous [Before(Test)] hook"); + await Timings.Record($"Before(Test): {executableHook.Name}", discoveredTest.TestContext, () => executableHook.ExecuteAsync(discoveredTest.TestContext, cancellationToken) ); } } + await logger.LogDebugAsync("Executing test body"); + await Timings.Record("Test Body", discoveredTest.TestContext, () => discoveredTest.ExecuteTest(cancellationToken)); @@ -68,24 +79,30 @@ private async ValueTask DisposeTest(TestContext testContext, List cle { if (executableHook.IsSynchronous) { + await logger.LogDebugAsync("Executing synchronous [After(Test)] hook"); + Timings.Record($"After(Test): {executableHook.Name}", testContext, () => executableHook.Execute(testContext, CancellationToken.None) ); } else { + await logger.LogDebugAsync("Executing asynchronous [After(Test)] hook"); + await Timings.Record($"After(Test): {executableHook.Name}", testContext, () => executableHook.ExecuteAsync(testContext, CancellationToken.None) ); } } + await logger.LogDebugAsync("Disposing test class"); await RunHelpers.RunValueTaskSafelyAsync(() => disposer.DisposeAsync(testContext.TestDetails.ClassInstance), cleanUpExceptions); await _consoleStandardOutLock.WaitAsync(); try { + await logger.LogDebugAsync("Disposing test context"); await disposer.DisposeAsync(testContext); } finally diff --git a/TUnit.Engine/Services/TestsExecutor.cs b/TUnit.Engine/Services/TestsExecutor.cs index c7110a7370..4e2aad7ec7 100644 --- a/TUnit.Engine/Services/TestsExecutor.cs +++ b/TUnit.Engine/Services/TestsExecutor.cs @@ -45,7 +45,10 @@ public TestsExecutor(SingleTestExecutor singleTestExecutor, public async Task ExecuteAsync(GroupedTests tests, ITestExecutionFilter? filter, ExecuteRequestContext context) { - using var _ = _engineCancellationToken.Token.Register(() => _onFinished.TrySetCanceled()); + using var _ = _engineCancellationToken.Token.Register(() => + { + _onFinished.TrySetCanceled(); + }); try { @@ -92,20 +95,13 @@ private async Task ProcessParallelGroups(IDictionary tests) { -#if NET - while (tests.TryDequeue(out var testInformation, out _)) - { - await ProcessTest(testInformation, filter, context, context.CancellationToken); - } -#else - await Task.Run(delegate + await Task.Run(async delegate { while (tests.TryDequeue(out var testInformation, out _)) { - ProcessTest(testInformation, filter, context, context.CancellationToken); + await ProcessTest(testInformation, filter, context, context.CancellationToken); } }); -#endif } private async Task ProcessParallelTests(IEnumerable queue, ITestExecutionFilter? filter, @@ -125,14 +121,9 @@ private async Task ProcessCollection(IEnumerable queue, CancellationToken = context.CancellationToken }, (test, token) => ProcessTest(test, filter, context, token)); #else - await Task.Run(delegate - { - Parallel.ForEach(queue, new ParallelOptions - { - MaxDegreeOfParallelism = _maximumParallelTests, - CancellationToken = context.CancellationToken - }, (test, token) => ProcessTest(test, filter, context, context.CancellationToken)); - }); + await queue + .ForEachAsync(test => ProcessTest(test, filter, context, context.CancellationToken)) + .ProcessInParallel(_maximumParallelTests); #endif } @@ -153,12 +144,12 @@ private async ValueTask ProcessTest(DiscoveredTest test, } } #else - private void ProcessTest(DiscoveredTest test, + private async Task ProcessTest(DiscoveredTest test, ITestExecutionFilter? filter, ExecuteRequestContext context, CancellationToken cancellationToken) { try { - _singleTestExecutor.ExecuteTestAsync(test, filter, context, false); + await _singleTestExecutor.ExecuteTestAsync(test, filter, context, false); } catch { From 0864ad7ec56bf5cc8ca85442830560d987724ad3 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 23 Dec 2024 18:42:12 +0000 Subject: [PATCH 44/71] Fix --- TUnit.Pipeline/Modules/RunEngineTestsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUnit.Pipeline/Modules/RunEngineTestsModule.cs b/TUnit.Pipeline/Modules/RunEngineTestsModule.cs index 367f3ff17c..d566c027df 100644 --- a/TUnit.Pipeline/Modules/RunEngineTestsModule.cs +++ b/TUnit.Pipeline/Modules/RunEngineTestsModule.cs @@ -23,7 +23,7 @@ public class RunEngineTestsModule : Module Project = project.Name, NoBuild = true, Configuration = Configuration.Release, - Framework = Environment.GetEnvironmentVariable("NET_VERSION"), + Framework = "net9.0", WorkingDirectory = project.Folder! }, cancellationToken); } From e170a13d357612e31cb56d38598460cced12f55c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:32:10 +0000 Subject: [PATCH 45/71] Fix --- .../CodeGenerators/Helpers/TestSourceDataModelRetriever.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 690c1faea4..4c93e365bd 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -154,8 +154,8 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext MethodArguments = testArguments, FilePath = testAttribute.ConstructorArguments[0].Value?.ToString() ?? string.Empty, LineNumber = testAttribute.ConstructorArguments[1].Value as int? ?? 0, - MethodParameterTypes = [..methodSymbol.Parameters.Select(x => x.Type.GloballyQualified())], - MethodParameterNames = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], + MethodParameterTypes = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], + MethodParameterNames = [..methodSymbol.Parameters.Select(x => x.Name)], MethodGenericTypeCount = methodSymbol.TypeParameters.Length, TestExecutor = allAttributes.FirstOrDefault(x => x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true)?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), TestAttributes = WriteAttributes(testGenerationContext.Context, testAttributes), From 94a40e21667336c15a48006202c663a3c0e31188 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:10:26 +0000 Subject: [PATCH 46/71] Source generate attribute invocations --- Directory.Packages.props | 2 +- .../ClassTupleDataSourceDrivenTests.cs | 8 +-- .../GlobalUsings.cs | 3 +- .../NumberArgumentTests.cs | 45 +------------ .../ReferencesHelper.cs | 3 +- .../TUnit.Core.SourceGenerator.Tests.csproj | 28 ++++++--- .../Helpers/TestSourceDataModelRetriever.cs | 63 +++---------------- .../CodeGenerators/TestHooksGenerator.cs | 2 + .../CodeGenerators/Writers/AttributeWriter.cs | 54 ++++++++++++++++ .../Writers/Hooks/AssemblyHooksWriter.cs | 10 ++- .../Writers/Hooks/ClassHooksWriter.cs | 7 +++ .../Writers/Hooks/GlobalTestHooksWriter.cs | 7 +++ .../Writers/Hooks/TestHooksWriter.cs | 13 ++++ .../Extensions/AttributeDataExtensions.cs | 11 +++- .../Arguments/GeneratedArgumentsContainer.cs | 1 + .../Models/HooksDataModel.cs | 6 +- TUnit.Core/Helpers/AttributeHelper.cs | 25 -------- TUnit.Core/Hooks/InstanceHookMethod.cs | 8 ++- TUnit.Core/Hooks/StaticHookMethod.cs | 8 ++- TUnit.Engine/Extensions/MethodExtensions.cs | 12 ---- 20 files changed, 157 insertions(+), 159 deletions(-) create mode 100644 TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs delete mode 100644 TUnit.Core/Helpers/AttributeHelper.cs delete mode 100644 TUnit.Engine/Extensions/MethodExtensions.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index b8cf90577a..2a021d81c6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -57,7 +57,7 @@ - + diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs index 7c248318f6..2c4754e7da 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs @@ -6,16 +6,12 @@ namespace TUnit.Core.SourceGenerator.Tests; internal class ClassTupleDataSourceDrivenTests : TestsBase { [Test] - [Arguments(0, "TupleMethod", "TupleMethod")] - [Arguments(0, "NamedTupleMethod", "TupleMethod")] - [Arguments(0, "TupleMethod", "NamedTupleMethod")] - [Arguments(0, "NamedTupleMethod", "NamedTupleMethod")] - public Task Test(int index, string classMethodName, string testMethodName) => RunTest(Path.Combine(Git.RootDirectory.FullName, + public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, "TUnit.TestProject", "ClassTupleDataSourceDrivenTests.cs"), async generatedFiles => { await Assert.That(generatedFiles.Length).IsEqualTo(1); - + await Verify(generatedFiles); }); } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalUsings.cs b/TUnit.Core.SourceGenerator.Tests/GlobalUsings.cs index 8a7d993317..3068556312 100644 --- a/TUnit.Core.SourceGenerator.Tests/GlobalUsings.cs +++ b/TUnit.Core.SourceGenerator.Tests/GlobalUsings.cs @@ -1,3 +1,2 @@ global using Assert = TUnit.Assertions.Assert; -global using TestAttribute = TUnit.Core.TestAttribute; -global using static TUnit.Core.HookType; \ No newline at end of file +global using TestAttribute = NUnit.Framework.TestAttribute; \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.cs b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.cs index 1fe78b4e8e..7ab7d04490 100644 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.cs +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.cs @@ -1,7 +1,4 @@ -using System.Globalization; using TUnit.Assertions.Extensions; -using TUnit.Core.Executors; -using TUnit.Core.Interfaces; using TUnit.Core.SourceGenerator.CodeGenerators; namespace TUnit.Core.SourceGenerator.Tests; @@ -18,45 +15,7 @@ public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, }); [Test] - [TestExecutor] + [SetCulture("de-DE")] + [SetUICulture("de-DE")] public Task TestDE() => Test(); - - public class SetCulture : GenericAbstractExecutor - { - protected override async Task ExecuteAsync(Func action) - { - var tcs = new TaskCompletionSource(); - - var thread = new Thread(() => - { - try - { - action().GetAwaiter().GetResult(); - tcs.SetResult(null); - } - catch (Exception e) - { - tcs.SetException(e); - } - }); - - var cultureInfoByIetfLanguageTag = CultureInfo.GetCultureInfoByIetfLanguageTag("de-DE"); - thread.CurrentCulture = cultureInfoByIetfLanguageTag; - thread.CurrentUICulture = cultureInfoByIetfLanguageTag; - thread.Start(); - - await tcs.Task; - } - - protected override void ExecuteSync(Action action) - { - var thread = new Thread(() => action()); - - var cultureInfoByIetfLanguageTag = CultureInfo.GetCultureInfoByIetfLanguageTag("de-DE"); - thread.CurrentCulture = cultureInfoByIetfLanguageTag; - thread.CurrentUICulture = cultureInfoByIetfLanguageTag; - thread.Start(); - thread.Join(); - } - } } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ReferencesHelper.cs b/TUnit.Core.SourceGenerator.Tests/ReferencesHelper.cs index 0d372ca5d7..45fb3192d8 100644 --- a/TUnit.Core.SourceGenerator.Tests/ReferencesHelper.cs +++ b/TUnit.Core.SourceGenerator.Tests/ReferencesHelper.cs @@ -1,6 +1,5 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; -using TUnit.TestProject.Library; namespace TUnit.Core.SourceGenerator.Tests; @@ -15,7 +14,7 @@ internal class ReferencesHelper // add your app/lib specifics, e.g.: MetadataReference.CreateFromFile(typeof(Attribute).Assembly.Location), MetadataReference.CreateFromFile(typeof(Assert).Assembly.Location), - MetadataReference.CreateFromFile(typeof(BaseTests).Assembly.Location), + MetadataReference.CreateFromFile("TUnit.TestProject.Library.dll"), MetadataReference.CreateFromFile("TUnit.Core.dll"), ]) .ToList(); diff --git a/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj b/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj index cf34c00c2c..29d617e28a 100644 --- a/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj +++ b/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj @@ -2,18 +2,30 @@ false - true - Exe - true - true - false - - + + - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + PreserveNewest + + + PreserveNewest + \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 4c93e365bd..87e73409ba 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -1,6 +1,7 @@ using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; +using TUnit.Core.SourceGenerator.CodeGenerators.Writers; using TUnit.Core.SourceGenerator.Enums; using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models; @@ -123,15 +124,15 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext var testArguments = testGenerationContext.TestArguments; var testAttribute = testGenerationContext.TestAttribute; - var testAttributes = methodSymbol.GetAttributes(); - var classAttributes = namedTypeSymbol.GetAttributesIncludingBaseTypes().ToImmutableArray(); - var assemblyAttributes = namedTypeSymbol.ContainingAssembly.GetAttributes(); + var testAttributes = methodSymbol.GetAttributes().ExcludingSystemAttributes(); + var classAttributes = namedTypeSymbol.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes(); + var assemblyAttributes = namedTypeSymbol.ContainingAssembly.GetAttributes().ExcludingSystemAttributes(); AttributeData[] allAttributes = [ - ..testAttributes.Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime"), - ..classAttributes.Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime"), - ..assemblyAttributes.Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime") + ..testAttributes, + ..classAttributes, + ..assemblyAttributes ]; var propertyAttributes = testGenerationContext.PropertyArguments @@ -158,57 +159,13 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext MethodParameterNames = [..methodSymbol.Parameters.Select(x => x.Name)], MethodGenericTypeCount = methodSymbol.TypeParameters.Length, TestExecutor = allAttributes.FirstOrDefault(x => x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true)?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), - TestAttributes = WriteAttributes(testGenerationContext.Context, testAttributes), - ClassAttributes = WriteAttributes(testGenerationContext.Context, classAttributes), - AssemblyAttributes = WriteAttributes(testGenerationContext.Context, assemblyAttributes), + TestAttributes = AttributeWriter.WriteAttributes(testGenerationContext.Context, testAttributes), + ClassAttributes = AttributeWriter.WriteAttributes(testGenerationContext.Context, classAttributes), + AssemblyAttributes = AttributeWriter.WriteAttributes(testGenerationContext.Context, assemblyAttributes), PropertyAttributeTypes = propertyAttributes.Select(x => x.AttributeClass?.GloballyQualified()).OfType().ToArray(), PropertyArguments = testGenerationContext.PropertyArguments, }; } - - private static string[] WriteAttributes(GeneratorAttributeSyntaxContext context, ImmutableArray attributeDatas) - { - return attributeDatas - .Where(x => x.AttributeClass?.ContainingAssembly?.Name != "System.Runtime") - .Select(x => WriteAttribute(context, x)) - .Where(x => !string.IsNullOrEmpty(x)) - .ToArray(); - } - - private static string WriteAttribute(GeneratorAttributeSyntaxContext context, AttributeData attributeData) - { - if (attributeData.ApplicationSyntaxReference is null) - { - return string.Empty; - } - - var attributeSyntax = attributeData.ApplicationSyntaxReference.GetSyntax(); - - var constructorArgumentSyntaxes = attributeSyntax.DescendantNodes() - .OfType() - .Where(x => x.NameEquals is null); - - var typedConstantsToExpression = - constructorArgumentSyntaxes.Zip(attributeData.ConstructorArguments, (syntax, constant) => (syntax, constant)); - - var constructorArguments = typedConstantsToExpression.Select(x => - TypedConstantParser.GetTypedConstantValue(context.SemanticModel, x.syntax.Expression, x.constant.Type)); - - var namedArgSyntaxes = attributeSyntax.DescendantNodes() - .OfType() - .Where(x => x.NameEquals is not null) - .ToArray(); - - var namedArguments = attributeData.NamedArguments.Select(x => - $"{x.Key} = {TypedConstantParser.GetTypedConstantValue(context.SemanticModel, namedArgSyntaxes.First(stx => stx.NameEquals?.Name.Identifier.ValueText == x.Key).Expression, x.Value.Type)},"); - - return $$""" - new {{attributeData.AttributeClass!.GloballyQualified()}}({{string.Join(", ", constructorArguments)}}) - { - {{string.Join(" ", namedArguments)}} - } - """; - } private static IEnumerable GetParameterTypes(IMethodSymbol methodSymbol, string[] argumentTypes) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/TestHooksGenerator.cs b/TUnit.Core.SourceGenerator/CodeGenerators/TestHooksGenerator.cs index 36785790c1..8166dffd7c 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/TestHooksGenerator.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/TestHooksGenerator.cs @@ -61,6 +61,8 @@ static IEnumerable GetSemanticTargetForGeneration(GeneratorAttri yield return new HooksDataModel { + Context = context, + Method = methodSymbol, MethodName = methodSymbol.Name, HookLocationType = hookLocationType, IsEveryHook = isEveryHook && hookLevel is not "TUnit.Core.HookType.TestDiscovery" and not "TUnit.Core.HookType.TestSession", diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs new file mode 100644 index 0000000000..64e2db23ab --- /dev/null +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs @@ -0,0 +1,54 @@ +using System.Collections.Immutable; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; +using TUnit.Core.SourceGenerator.Extensions; + +namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers; + +public class AttributeWriter +{ + public static string[] WriteAttributes(GeneratorAttributeSyntaxContext context, ImmutableArray attributeDatas) + { + return attributeDatas + .Where(x => x.AttributeClass?.ContainingAssembly?.Name != "System.Runtime") + .Select(x => WriteAttribute(context, x)) + .Where(x => !string.IsNullOrEmpty(x)) + .ToArray(); + } + + public static string WriteAttribute(GeneratorAttributeSyntaxContext context, AttributeData attributeData) + { + if (attributeData.ApplicationSyntaxReference is null) + { + return string.Empty; + } + + var attributeSyntax = attributeData.ApplicationSyntaxReference.GetSyntax(); + + var constructorArgumentSyntaxes = attributeSyntax.DescendantNodes() + .OfType() + .Where(x => x.NameEquals is null); + + var typedConstantsToExpression = + constructorArgumentSyntaxes.Zip(attributeData.ConstructorArguments, (syntax, constant) => (syntax, constant)); + + var constructorArguments = typedConstantsToExpression.Select(x => + TypedConstantParser.GetTypedConstantValue(context.SemanticModel, x.syntax.Expression, x.constant.Type)); + + var namedArgSyntaxes = attributeSyntax.DescendantNodes() + .OfType() + .Where(x => x.NameEquals is not null) + .ToArray(); + + var namedArguments = attributeData.NamedArguments.Select(x => + $"{x.Key} = {TypedConstantParser.GetTypedConstantValue(context.SemanticModel, namedArgSyntaxes.First(stx => stx.NameEquals?.Name.Identifier.ValueText == x.Key).Expression, x.Value.Type)},"); + + return $$""" + new {{attributeData.AttributeClass!.GloballyQualified()}}({{string.Join(", ", constructorArguments)}}) + { + {{string.Join(" ", namedArguments)}} + } + """; + } +} \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs index c6f6a15ec4..17ea1bbbe0 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs @@ -1,5 +1,7 @@ -using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; +using System.Collections.Immutable; +using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; using TUnit.Core.SourceGenerator.Enums; +using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models; namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers.Hooks; @@ -38,6 +40,12 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel? model sourceBuilder.WriteLine($"Order = {model.Order},"); sourceBuilder.WriteLine($"""FilePath = @"{model.FilePath}","""); sourceBuilder.WriteLine($"LineNumber = {model.LineNumber},"); + sourceBuilder.WriteLine( + $"MethodAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"ClassAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingType.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"AssemblyAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingAssembly.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); sourceBuilder.WriteLine("},"); } diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs index 44b484bff8..ddd6ac6bdd 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs @@ -1,5 +1,6 @@ using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; using TUnit.Core.SourceGenerator.Enums; +using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models; namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers.Hooks; @@ -33,6 +34,12 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"Order = {model.Order},"); sourceBuilder.WriteLine($"""FilePath = @"{model.FilePath}","""); sourceBuilder.WriteLine($"LineNumber = {model.LineNumber},"); + sourceBuilder.WriteLine( + $"MethodAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"ClassAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingType.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"AssemblyAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingAssembly.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); sourceBuilder.WriteLine("},"); } diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs index b00073b356..d45a90cc45 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs @@ -1,5 +1,6 @@ using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; using TUnit.Core.SourceGenerator.Enums; +using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models; namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers.Hooks; @@ -27,6 +28,12 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"Order = {model.Order},"); sourceBuilder.WriteLine($"""FilePath = @"{model.FilePath}","""); sourceBuilder.WriteLine($"LineNumber = {model.LineNumber},"); + sourceBuilder.WriteLine( + $"MethodAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"ClassAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingType.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"AssemblyAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingAssembly.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); sourceBuilder.WriteLine("},"); } diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index c5416a26a1..9f703bad26 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -1,5 +1,6 @@ using TUnit.Core.SourceGenerator.CodeGenerators.Helpers; using TUnit.Core.SourceGenerator.Enums; +using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models; namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers.Hooks; @@ -35,6 +36,12 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"Order = {model.Order},"); sourceBuilder.WriteLine($"""FilePath = @"{model.FilePath}","""); sourceBuilder.WriteLine($"LineNumber = {model.LineNumber},"); + sourceBuilder.WriteLine( + $"MethodAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"ClassAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingType.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"AssemblyAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingAssembly.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); sourceBuilder.WriteLine("},"); return; @@ -55,6 +62,12 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"HookExecutor = {HookExecutorHelper.GetHookExecutor(model.HookExecutor)},"); sourceBuilder.WriteLine($"Order = {model.Order},"); + sourceBuilder.WriteLine( + $"MethodAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"ClassAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingType.GetAttributesIncludingBaseTypes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); + sourceBuilder.WriteLine( + $"AssemblyAttributes = [ {AttributeWriter.WriteAttributes(model.Context, model.Method.ContainingAssembly.GetAttributes().ExcludingSystemAttributes()).ToCommaSeparatedString()} ],"); sourceBuilder.WriteLine("},"); } } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/Extensions/AttributeDataExtensions.cs b/TUnit.Core.SourceGenerator/Extensions/AttributeDataExtensions.cs index feb7c14e1c..a2debe6a78 100644 --- a/TUnit.Core.SourceGenerator/Extensions/AttributeDataExtensions.cs +++ b/TUnit.Core.SourceGenerator/Extensions/AttributeDataExtensions.cs @@ -1,4 +1,5 @@ -using Microsoft.CodeAnalysis; +using System.Collections.Immutable; +using Microsoft.CodeAnalysis; namespace TUnit.Core.SourceGenerator.Extensions; @@ -63,4 +64,12 @@ public static bool IsGlobalHook(this AttributeData attributeData, Compilation co compilation.GetTypeByMetadataName(WellKnownFullyQualifiedClassNames.AfterEveryAttribute .WithoutGlobalPrefix)); } + + public static ImmutableArray ExcludingSystemAttributes( + this IEnumerable attributeDatas) + { + return attributeDatas + .Where(x => x.AttributeClass?.ContainingAssembly.Name != "System.Runtime") + .ToImmutableArray(); + } } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs b/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs index 008b32f606..52bd5e9a7e 100644 --- a/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs +++ b/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs @@ -1,3 +1,4 @@ +using TUnit.Core.SourceGenerator.CodeGenerators.Writers; using TUnit.Core.SourceGenerator.Enums; namespace TUnit.Core.SourceGenerator.Models.Arguments; diff --git a/TUnit.Core.SourceGenerator/Models/HooksDataModel.cs b/TUnit.Core.SourceGenerator/Models/HooksDataModel.cs index 9f5668a33e..1d9c655f28 100644 --- a/TUnit.Core.SourceGenerator/Models/HooksDataModel.cs +++ b/TUnit.Core.SourceGenerator/Models/HooksDataModel.cs @@ -1,9 +1,11 @@ -using TUnit.Core.SourceGenerator.Enums; +using Microsoft.CodeAnalysis; +using TUnit.Core.SourceGenerator.Enums; namespace TUnit.Core.SourceGenerator.Models; public record HooksDataModel { + public required GeneratorAttributeSyntaxContext Context { get; init; } public required string FullyQualifiedTypeName { get; init; } public required HookLocationType HookLocationType { get; init; } public required string MinimalTypeName { get; init; } @@ -20,6 +22,8 @@ public record HooksDataModel public required bool IsEveryHook { get; init; } public required bool IsVoid { get; init; } + + public required IMethodSymbol Method { get; init; } public virtual bool Equals(HooksDataModel? other) { diff --git a/TUnit.Core/Helpers/AttributeHelper.cs b/TUnit.Core/Helpers/AttributeHelper.cs deleted file mode 100644 index 65536d04d2..0000000000 --- a/TUnit.Core/Helpers/AttributeHelper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Reflection; - -namespace TUnit.Core.Helpers; - -internal static class AttributeHelper -{ - public static TAttribute? GetAttribute(Type type, MethodInfo methodInfo) where TAttribute : Attribute - { - return methodInfo.GetCustomAttributes() - .Concat(type.GetCustomAttributes()) - .FirstOrDefault(); - } - - public static TAttribute? GetAttribute(MethodInfo methodInfo) where TAttribute : Attribute - { - return methodInfo.GetCustomAttributes().FirstOrDefault(); - } - - public static TAttribute? GetAttribute(IEnumerable attributes) where TAttribute : Attribute - { - return attributes - .OfType() - .FirstOrDefault(); - } -} \ No newline at end of file diff --git a/TUnit.Core/Hooks/InstanceHookMethod.cs b/TUnit.Core/Hooks/InstanceHookMethod.cs index b42b432e1b..8a5aa01d1b 100644 --- a/TUnit.Core/Hooks/InstanceHookMethod.cs +++ b/TUnit.Core/Hooks/InstanceHookMethod.cs @@ -47,11 +47,15 @@ public abstract record InstanceHookMethod [field: AllowNull, MaybeNull] public string Name => field ??= $"{ClassType.Name}.{MethodInfo.Name}({string.Join(", ", MethodInfo.GetParameters().Select(x => x.ParameterType.Name))})"; + public required Attribute[] MethodAttributes { get; init; } + public required Attribute[] ClassAttributes { get; init; } + public required Attribute[] AssemblyAttributes { get; init; } + [field: AllowNull, MaybeNull] public IEnumerable Attributes => field ??= - [..MethodInfo.GetCustomAttributes(), ..ClassType.GetCustomAttributes(), ..Assembly.GetCustomAttributes()]; + [..MethodAttributes, ..ClassAttributes, ..AssemblyAttributes]; - public TAttribute? GetAttribute() where TAttribute : Attribute => AttributeHelper.GetAttribute(Attributes); + public TAttribute? GetAttribute() where TAttribute : Attribute => Attributes.OfType().FirstOrDefault(); public TimeSpan? Timeout => GetAttribute()?.Timeout; diff --git a/TUnit.Core/Hooks/StaticHookMethod.cs b/TUnit.Core/Hooks/StaticHookMethod.cs index d84fca4570..c311ddc0db 100644 --- a/TUnit.Core/Hooks/StaticHookMethod.cs +++ b/TUnit.Core/Hooks/StaticHookMethod.cs @@ -29,12 +29,16 @@ public abstract record StaticHookMethod public string Name => field ??= $"{ClassType.Name}.{MethodInfo.Name}({string.Join(", ", MethodInfo.GetParameters().Select(x => x.ParameterType.Name))})"; public Type ClassType => MethodInfo.ReflectedType!; public Assembly Assembly => ClassType.Assembly; + + public required Attribute[] MethodAttributes { get; init; } + public required Attribute[] ClassAttributes { get; init; } + public required Attribute[] AssemblyAttributes { get; init; } [field: AllowNull, MaybeNull] public IEnumerable Attributes => field ??= - [..MethodInfo.GetCustomAttributes(), ..ClassType.GetCustomAttributes(), ..Assembly.GetCustomAttributes()]; + [..MethodAttributes, ..ClassAttributes, ..AssemblyAttributes]; - public TAttribute? GetAttribute() where TAttribute : Attribute => AttributeHelper.GetAttribute(Attributes); + public TAttribute? GetAttribute() where TAttribute : Attribute => Attributes.OfType().FirstOrDefault(); public TimeSpan? Timeout => GetAttribute()?.Timeout; diff --git a/TUnit.Engine/Extensions/MethodExtensions.cs b/TUnit.Engine/Extensions/MethodExtensions.cs deleted file mode 100644 index 1d3d6bc937..0000000000 --- a/TUnit.Engine/Extensions/MethodExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using TUnit.Core; - -namespace TUnit.Engine.Extensions; - -internal static class MethodExtensions -{ - public static TimeSpan? GetTimeout(this MethodInfo methodInfo) - { - return methodInfo.GetCustomAttributes().OfType().FirstOrDefault()?.Timeout; - } -} \ No newline at end of file From 491e76346e915c95b47219e9c26548c17a51ad5b Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:21:31 +0000 Subject: [PATCH 47/71] MethodInfoRetriever --- .../Helpers/TestSourceDataModelRetriever.cs | 1 - .../Writers/FailedTestInitializationWriter.cs | 2 +- .../Writers/GenericTestInvocationWriter.cs | 2 +- .../Writers/Hooks/AssemblyHooksWriter.cs | 2 +- .../Writers/Hooks/ClassHooksWriter.cs | 2 +- .../Writers/Hooks/GlobalTestHooksWriter.cs | 2 +- .../Writers/Hooks/TestHooksWriter.cs | 4 +-- .../Writers/MethodInfoWriter.cs | 33 ++++--------------- .../Models/TestSourceDataModel.cs | 3 +- TUnit.Core/Helpers/MethodInfoRetriever.cs | 30 +++++++++++++++++ 10 files changed, 46 insertions(+), 35 deletions(-) create mode 100644 TUnit.Core/Helpers/MethodInfoRetriever.cs diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index 87e73409ba..ecb52e7dcb 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -1,6 +1,5 @@ using System.Collections.Immutable; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; using TUnit.Core.SourceGenerator.CodeGenerators.Writers; using TUnit.Core.SourceGenerator.Enums; using TUnit.Core.SourceGenerator.Extensions; diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs index e67155ee90..5f8de4c81f 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs @@ -14,7 +14,7 @@ public static void GenerateFailedTestCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine("{"); sourceBuilder.WriteLine($"TestId = $\"{testId}\","); sourceBuilder.WriteLine($"TestClass = typeof({testSourceDataModel.FullyQualifiedTypeName}),"); - sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes, false)}.ReturnType,"); + sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel)}.ReturnType,"); sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterTypes.Select(x => $"typeof({x})"))}],"); sourceBuilder.WriteLine($"TestName = \"{testSourceDataModel.MethodName}\","); sourceBuilder.WriteLine($"TestFilePath = @\"{testSourceDataModel.FilePath}\","); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs index f36beb6775..c354856970 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/GenericTestInvocationWriter.cs @@ -15,7 +15,7 @@ public static void GenerateTestInvocationCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine($"var testClassType = typeof({fullyQualifiedClassType});"); - sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel.FullyQualifiedTypeName, testSourceDataModel.MethodName, testSourceDataModel.MethodParameterTypes, false)};"); + sourceBuilder.WriteLine($"var methodInfo = {MethodInfoWriter.Write(testSourceDataModel)};"); sourceBuilder.WriteLine(); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs index 17ea1bbbe0..9800225ee0 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/AssemblyHooksWriter.cs @@ -25,7 +25,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel? model } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs index ddd6ac6bdd..e566db6be1 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/ClassHooksWriter.cs @@ -19,7 +19,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs index d45a90cc45..abaaa0f087 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/GlobalTestHooksWriter.cs @@ -11,7 +11,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) { sourceBuilder.WriteLine($"new {GetClassType(model.HookLevel, model.HookLocationType)}"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, true)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model)},"""); if (model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs index 9f703bad26..39c528b540 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/Hooks/TestHooksWriter.cs @@ -21,7 +21,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) } sourceBuilder.WriteLine("{ "); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, model.IsEveryHook)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model)},"""); if(model.IsVoid) { @@ -49,7 +49,7 @@ public static void Execute(SourceCodeWriter sourceBuilder, HooksDataModel model) sourceBuilder.WriteLine($"new InstanceHookMethod<{model.FullyQualifiedTypeName}>"); sourceBuilder.WriteLine("{"); - sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model.FullyQualifiedTypeName, model.MethodName, model.ParameterTypes, model.IsEveryHook)},"""); + sourceBuilder.WriteLine($"""MethodInfo = {MethodInfoWriter.Write(model)},"""); if(model.IsVoid) { diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs index 902c5c74b3..4d13ede9d9 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs @@ -1,35 +1,16 @@ -namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers; +using TUnit.Core.SourceGenerator.Models; + +namespace TUnit.Core.SourceGenerator.CodeGenerators.Writers; public static class MethodInfoWriter { - public static string Write(string type, string methodName, string[] parameters, bool isStatic) - { - return isStatic ? WriteStatic(type, methodName, parameters) : WriteInstance(type, methodName, parameters); - } - - private static string WriteInstance(string type, string methodName, string[] parameters) + public static string Write(TestSourceDataModel testSourceDataModel) { - string[] actionTypes = - [ - type, - ..parameters - ]; - - var actionLambdaParameters = actionTypes.Select((x, i) => $"{x} a{i}"); - - return - $"((Action<{string.Join(", ", actionTypes)}>)(({string.Join(", ", actionLambdaParameters)}) => a0.{methodName}({string.Join(", ", parameters.Select((x, i) => $"a{i+1}"))}))).Method"; + return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({testSourceDataModel.FullyQualifiedTypeName}), \"{testSourceDataModel.MethodName}\", {testSourceDataModel.MethodGenericTypeCount}, [{string.Join(", ", testSourceDataModel.MethodParameterTypes.Select(x => $"typeof({x})"))}])"; } - private static string WriteStatic(string type, string methodName, string[] parameters) + public static string Write(HooksDataModel hooksDataModel) { - var actionType = parameters.Length == 0 - ? "Action" - : $"Action<{string.Join(", ", parameters)}>"; - - var actionLambdaParameters = parameters.Select((x, i) => $"{x} a{i}"); - - return - $"(({actionType})(({string.Join(", ", actionLambdaParameters)}) => {type}.{methodName}({string.Join(", ", parameters.Select((x, i) => $"a{i}"))}))).Method"; + return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({hooksDataModel.FullyQualifiedTypeName}), \"{hooksDataModel.MethodName}\", 0, [{string.Join(", ", hooksDataModel.ParameterTypes.Select(x => $"typeof({x})"))}])"; } } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs index 8f4e4af154..76835d9df9 100644 --- a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs +++ b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs @@ -1,4 +1,5 @@ -using TUnit.Core.SourceGenerator.Extensions; +using Microsoft.CodeAnalysis; +using TUnit.Core.SourceGenerator.Extensions; using TUnit.Core.SourceGenerator.Models.Arguments; namespace TUnit.Core.SourceGenerator.Models; diff --git a/TUnit.Core/Helpers/MethodInfoRetriever.cs b/TUnit.Core/Helpers/MethodInfoRetriever.cs new file mode 100644 index 0000000000..04f6aabb4d --- /dev/null +++ b/TUnit.Core/Helpers/MethodInfoRetriever.cs @@ -0,0 +1,30 @@ +using System.Diagnostics.CodeAnalysis; +using System.Reflection; + +namespace TUnit.Core.Helpers; + +public class MethodInfoRetriever +{ + public static MethodInfo? GetMethodInfo([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, + string methodName, + int genericParameterCount, + Type[] parameterTypes) + { +#if NET + + return type.GetMethod(methodName, genericParameterCount, parameterTypes); +#else + if (genericParameterCount == 0) + { + return type.GetMethod(methodName, parameterTypes); + } + + return type + .GetMethods() + .Where(x => x.Name == methodName) + .Where(x => x.IsGenericMethod) + .Where(x => x.GetGenericArguments().Length == genericParameterCount) + .FirstOrDefault(x => x.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes)); +#endif + } +} \ No newline at end of file From 6b4b88eb1001c79a274f0060c19c9e7edec55fa8 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:21:52 +0000 Subject: [PATCH 48/71] MethodInfoRetriever --- ...ractTests.Concrete1.DotNet9_0.received.txt | 90 + ...ractTests.Concrete2.DotNet9_0.received.txt | 274 + .../AfterAllTests.Test.DotNet9_0.received.txt | 875 +++ .../AfterTests.Test.DotNet9_0.received.txt | 875 +++ ...mblyAfterTests.Test.DotNet9_0.received.txt | 875 +++ ...blyBeforeTests.Test.DotNet9_0.received.txt | 875 +++ .../BasicTests.Test.DotNet9_0.received.txt | 259 + ...BeforeAllTests.Test.DotNet9_0.received.txt | 875 +++ .../BeforeTests.Test.DotNet9_0.received.txt | 875 +++ ...ArgumentsTests.Test.DotNet9_0.received.txt | 846 +++ ...onstructorTest.Test.DotNet9_0.received.txt | 88 + ...rceDrivenTests.Test.DotNet9_0.received.txt | 768 +++ ...ceDrivenTests2.Test.DotNet9_0.received.txt | 399 ++ ...stsSharedKeyed.Test.DotNet9_0.received.txt | 215 + ...rceDrivenTests.Test.DotNet9_0.received.txt | 396 ++ ...pleDataSourceDrivenTests.Test.verified.txt | 396 ++ ...reteClassTests.Test.DotNet9_0.received.txt | 274 + ...ArgumentsTests.Test.DotNet9_0.received.txt | 638 ++ ...BaseClassTests.Test.DotNet9_0.received.txt | 92 + ...edStringsTests.Test.DotNet9_0.received.txt | 92 + ...ataDrivenTests.Test.DotNet9_0.received.txt | 1534 +++++ ...rceMethodTests.Test.DotNet9_0.received.txt | 766 +++ ...GeneratorTests.Test.DotNet9_0.received.txt | 764 +++ ...mberNamesTests.Test.DotNet9_0.received.txt | 247 + ...rceDrivenTests.Test.DotNet9_0.received.txt | 283 + ...rceDrivenTests.Test.DotNet9_0.received.txt | 182 + ...ricMethodTests.Test.DotNet9_0.received.txt | 188 + ...AfterEachTests.Test.DotNet9_0.received.txt | 875 +++ ...eforeEachTests.Test.DotNet9_0.received.txt | 875 +++ ...rtySetterTests.Test.DotNet9_0.received.txt | 326 ++ ...ntProjectTests.Test.DotNet9_0.received.txt | 365 ++ .../MatrixTests.Test.DotNet9_0.received.txt | 5142 +++++++++++++++++ ...rceDrivenTests.Test.DotNet9_0.received.txt | 947 +++ ...tionTokenTests.Test.DotNet9_0.received.txt | 548 ++ ...rceDrivenTests.Test.DotNet9_0.received.txt | 227 + ...fArgumentTests.Test.DotNet9_0.received.txt | 92 + ...eArgumentTests.Test.DotNet9_0.received.txt | 337 ++ ...rArgumentTests.Test.DotNet9_0.received.txt | 547 ++ ...rgumentTests.TestDE.DotNet9_0.received.txt | 547 ++ ...FilteringTests.Test.DotNet9_0.received.txt | 535 ++ ...rtySetterTests.Test.DotNet9_0.received.txt | 162 + .../RepeatTests.Test.DotNet9_0.received.txt | 682 +++ ...readHooksTests.Test.DotNet9_0.received.txt | 135 + ...gArgumentTests.Test.DotNet9_0.received.txt | 1490 +++++ ...overyHookTests.Test.DotNet9_0.received.txt | 103 + ...tionTokenTests.Test.DotNet9_0.received.txt | 748 +++ ...rceDrivenTests.Test.DotNet9_0.received.txt | 94 + 47 files changed, 28818 insertions(+) create mode 100644 TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt new file mode 100644 index 0000000000..a020c085a6 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt @@ -0,0 +1,90 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_ConcreteClass1()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass1() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AssertClassName", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt new file mode 100644 index 0000000000..1e012bce0b --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt @@ -0,0 +1,274 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConcreteClass2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass2() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SecondTest()), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +}, new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "SecondTest", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_ConcreteClass2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass2() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +}, new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AssertClassName", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_ConcreteClass1()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass1() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AssertClassName", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..1d055a9dd1 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..1d055a9dd1 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..8f845aebe8 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..4078cfd9c5 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..0e13e51696 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt @@ -0,0 +1,259 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new BasicTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.BasicTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.BasicTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.BasicTests.SynchronousTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SynchronousTest()), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.BasicTests.SynchronousTest:0", + TestClass = typeof(global::TUnit.TestProject.BasicTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "SynchronousTest", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new BasicTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.BasicTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.BasicTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.BasicTests.AsynchronousTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AsynchronousTest()), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.BasicTests.AsynchronousTest:0", + TestClass = typeof(global::TUnit.TestProject.BasicTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AsynchronousTest", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new BasicTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.BasicTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.BasicTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.BasicTests.ValueTaskAsynchronousTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ValueTaskAsynchronousTest()), + TestFilePath = @"", + TestLineNumber = 17, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.BasicTests.ValueTaskAsynchronousTest:0", + TestClass = typeof(global::TUnit.TestProject.BasicTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "ValueTaskAsynchronousTest", + TestFilePath = @"", + TestLineNumber = 17, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..ec356791e0 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..ec356791e0 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..b58d86e94f --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt @@ -0,0 +1,846 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "1"; + + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", + TestClassArguments = [classArg], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Simple()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Simple", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "2"; + + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", + TestClassArguments = [classArg], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Simple()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Simple", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "1"; + + + global::System.String methodArg = "3"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "WithMethodLevel", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "2"; + + + global::System.String methodArg = "3"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "WithMethodLevel", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "1"; + + + global::System.String methodArg = "4"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "WithMethodLevel", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "2"; + + + global::System.String methodArg = "4"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "WithMethodLevel", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "1"; + + + global::System.String methodArg = "3"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), + TestFilePath = @"", + TestLineNumber = 16, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "IgnoreParameters", + TestFilePath = @"", + TestLineNumber = 16, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "2"; + + + global::System.String methodArg = "3"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), + TestFilePath = @"", + TestLineNumber = 16, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "IgnoreParameters", + TestFilePath = @"", + TestLineNumber = 16, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "1"; + + + global::System.String methodArg = "4"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), + TestFilePath = @"", + TestLineNumber = 16, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "IgnoreParameters", + TestFilePath = @"", + TestLineNumber = 16, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String classArg = "2"; + + + global::System.String methodArg = "4"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), + TestFilePath = @"", + TestLineNumber = 16, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("3") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("4") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("2") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "IgnoreParameters", + TestFilePath = @"", + TestLineNumber = 16, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..82ecb6fe7a --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt @@ -0,0 +1,88 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassConstructorTest : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassConstructorTest()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassConstructorTest); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassConstructorAttribute:{classDataIndex}:CL-CCA0:TUnit.TestProject.ClassConstructorTest(TUnit.TestProject.DummyReferenceTypeClass).Test:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassConstructorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassConstructorAttribute:{classDataIndex}:CL-CCA0:TUnit.TestProject.ClassConstructorTest(TUnit.TestProject.DummyReferenceTypeClass).Test:0", + TestClass = typeof(global::TUnit.TestProject.ClassConstructorTest), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..f263d21a73 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,768 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], + TestName = "DataSource_Class", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class_Generic(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class_Generic(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 17, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class_Generic(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], + TestName = "DataSource_Class_Generic", + TestFilePath = @"", + TestLineNumber = 17, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_1_ClassDataSource(TUnit.TestProject.InitializableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_1_ClassDataSource(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_1_ClassDataSource(TUnit.TestProject.InitializableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass)], + TestName = "IsInitialized_With_1_ClassDataSource", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; + global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_2_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_2_ClassDataSources(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 31, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_2_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], + TestName = "IsInitialized_With_2_ClassDataSources", + TestFilePath = @"", + TestLineNumber = 31, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; + global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; + global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_3_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_3_ClassDataSources(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 39, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_3_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], + TestName = "IsInitialized_With_3_ClassDataSources", + TestFilePath = @"", + TestLineNumber = 39, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; + global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; + global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; + global::TUnit.TestProject.InitializableClass methodArg3 = methodArgGeneratedData.Item4; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_4_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_4_ClassDataSources(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 48, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_4_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], + TestName = "IsInitialized_With_4_ClassDataSources", + TestFilePath = @"", + TestLineNumber = 48, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; + global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; + global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; + global::TUnit.TestProject.InitializableClass methodArg3 = methodArgGeneratedData.Item4; + global::TUnit.TestProject.InitializableClass methodArg4 = methodArgGeneratedData.Item5; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_5_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_5_ClassDataSources(methodArg, methodArg1, methodArg2, methodArg3, methodArg4)), + TestFilePath = @"", + TestLineNumber = 58, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_5_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], + TestName = "IsInitialized_With_5_ClassDataSources", + TestFilePath = @"", + TestLineNumber = 58, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..2cd2dd3ed2 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt @@ -0,0 +1,399 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", + TestClassArguments = [classArgGeneratedData], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived1()), + TestFilePath = @"", + TestLineNumber = 9, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Base_Derived1", + TestFilePath = @"", + TestLineNumber = 9, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", + TestClassArguments = [classArgGeneratedData], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived1()), + TestFilePath = @"", + TestLineNumber = 9, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Base_Derived1", + TestFilePath = @"", + TestLineNumber = 9, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTests2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", + TestClassArguments = [classArgGeneratedData], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived2()), + TestFilePath = @"", + TestLineNumber = 15, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Base_Derived2", + TestFilePath = @"", + TestLineNumber = 15, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", + TestClassArguments = [classArgGeneratedData], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived2()), + TestFilePath = @"", + TestLineNumber = 15, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Base_Derived2", + TestFilePath = @"", + TestLineNumber = 15, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..533d8fd388 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt @@ -0,0 +1,215 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTestsSharedKeyed()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class(SomeAsyncDisposableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 7, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class(SomeAsyncDisposableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], + TestName = "DataSource_Class", + TestFilePath = @"", + TestLineNumber = 7, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassDataSourceDrivenTestsSharedKeyed()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class_Generic(SomeAsyncDisposableClass):0", + TestClassArguments = [], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class_Generic(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class_Generic(SomeAsyncDisposableClass):0", + TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, + ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], + TestName = "DataSource_Class_Generic", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..5fdb8c1ce3 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,396 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassTupleDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt new file mode 100644 index 0000000000..e015e81335 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt @@ -0,0 +1,396 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ClassTupleDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); + var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 classArg = classArgTuples.Item1; + global::System.String classArg1 = classArgTuples.Item2; + global::System.Boolean classArg2 = classArgTuples.Item3; + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); + (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), + ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..1e012bce0b --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt @@ -0,0 +1,274 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConcreteClass2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass2() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SecondTest()), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +}, new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "SecondTest", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_ConcreteClass2()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass2() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +}, new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AssertClassName", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_ConcreteClass1()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.AbstractTests.ConcreteClass1() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", + TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "AssertClassName", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..38ae14d284 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt @@ -0,0 +1,638 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "123"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.String1(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.String1(methodArg)), + TestFilePath = @"", + TestLineNumber = 16, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("123") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.String1(System.String):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "String1", + TestFilePath = @"", + TestLineNumber = 16, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 123; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Int(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), + TestFilePath = @"", + TestLineNumber = 23, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(123) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Int(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "Int", + TestFilePath = @"", + TestLineNumber = 23, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Double methodArg = 1.23; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Double(System.Double):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), + TestFilePath = @"", + TestLineNumber = 30, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.23) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Double(System.Double):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Double)], + TestName = "Double", + TestFilePath = @"", + TestLineNumber = 30, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Single methodArg = 1.23F; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Float(System.Single):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), + TestFilePath = @"", + TestLineNumber = 37, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.23F) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Float(System.Single):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Single)], + TestName = "Float", + TestFilePath = @"", + TestLineNumber = 37, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int64 methodArg = 123L; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Long(System.Int64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), + TestFilePath = @"", + TestLineNumber = 44, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(123L) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Long(System.Int64):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int64)], + TestName = "Long", + TestFilePath = @"", + TestLineNumber = 44, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt32 methodArg = 123U; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.UInt(System.UInt32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), + TestFilePath = @"", + TestLineNumber = 51, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(123U) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.UInt(System.UInt32):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt32)], + TestName = "UInt", + TestFilePath = @"", + TestLineNumber = 51, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantArgumentsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt64 methodArg = 123UL; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.ConstantArgumentsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.ULong(System.UInt64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), + TestFilePath = @"", + TestLineNumber = 58, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(123UL) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.ULong(System.UInt64):0", + TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt64)], + TestName = "ULong", + TestFilePath = @"", + TestLineNumber = 58, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..84ae34a537 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt @@ -0,0 +1,92 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantInBaseClassTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantInBaseClassTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "Value"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests.SomeTest(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 13, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("Value") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests.SomeTest(System.String):0", + TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "SomeTest", + TestFilePath = @"", + TestLineNumber = 13, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..edc9140fb5 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt @@ -0,0 +1,92 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class ConstantsInInterpolatedStringsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new ConstantsInInterpolatedStringsTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = $"{"Value"}1"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests.SomeTest(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 13, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute($"{"Value"}1") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests.SomeTest(System.String):0", + TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "SomeTest", + TestFilePath = @"", + TestLineNumber = 13, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..efa0940f14 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,1534 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.String methodArg1 = "String"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.String methodArg1 = "String2"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 3; + global::System.String methodArg1 = "String3"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(2) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(3) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::TUnit.TestProject.TestEnum methodArg = global::TUnit.TestProject.TestEnum.One; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), + TestFilePath = @"", + TestLineNumber = 23, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(-1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], + TestName = "EnumValue", + TestFilePath = @"", + TestLineNumber = 23, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::TUnit.TestProject.TestEnum methodArg = global::TUnit.TestProject.TestEnum.Two; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), + TestFilePath = @"", + TestLineNumber = 23, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(-1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], + TestName = "EnumValue", + TestFilePath = @"", + TestLineNumber = 23, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::TUnit.TestProject.TestEnum methodArg = (global::TUnit.TestProject.TestEnum)(-1); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), + TestFilePath = @"", + TestLineNumber = 23, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(-1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], + TestName = "EnumValue", + TestFilePath = @"", + TestLineNumber = 23, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = null; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NullValue(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NullValue(methodArg)), + TestFilePath = @"", + TestLineNumber = 32, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NullValue(System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "NullValue", + TestFilePath = @"", + TestLineNumber = 32, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = ""; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EmptyString(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EmptyString(methodArg)), + TestFilePath = @"", + TestLineNumber = 39, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EmptyString(System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "EmptyString", + TestFilePath = @"", + TestLineNumber = 39, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "Foo bar!"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NonEmptyString(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NonEmptyString(methodArg)), + TestFilePath = @"", + TestLineNumber = 46, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("Foo bar!") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NonEmptyString(System.String):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "NonEmptyString", + TestFilePath = @"", + TestLineNumber = 46, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Boolean? methodArg = null; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), + TestFilePath = @"", + TestLineNumber = 53, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(false) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(true) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Boolean?)], + TestName = "BooleanString", + TestFilePath = @"", + TestLineNumber = 53, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Boolean? methodArg = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), + TestFilePath = @"", + TestLineNumber = 53, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(false) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(true) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Boolean?)], + TestName = "BooleanString", + TestFilePath = @"", + TestLineNumber = 53, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Boolean? methodArg = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), + TestFilePath = @"", + TestLineNumber = 53, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(false) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(true) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Boolean?)], + TestName = "BooleanString", + TestFilePath = @"", + TestLineNumber = 53, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Type methodArg = typeof(global::System.Object); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.Type(System.Type):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Type(methodArg)), + TestFilePath = @"", + TestLineNumber = 62, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(typeof(global::System.Object)) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.Type(System.Type):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Type)], + TestName = "Type", + TestFilePath = @"", + TestLineNumber = 62, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32[] methodArg = new[] { 1, 2, 3 }; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntegerArray(System.Int32[]):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IntegerArray(methodArg)), + TestFilePath = @"", + TestLineNumber = 69, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(new[] { 1, 2, 3 }) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntegerArray(System.Int32[]):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32[])], + TestName = "IntegerArray", + TestFilePath = @"", + TestLineNumber = 69, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::System.Int32.MaxValue; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntMaxValue(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IntMaxValue(methodArg)), + TestFilePath = @"", + TestLineNumber = 76, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(global::System.Int32.MaxValue) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntMaxValue(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "IntMaxValue", + TestFilePath = @"", + TestLineNumber = 76, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..06be90d647 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt @@ -0,0 +1,766 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataSourceClassCombinedWithDataSourceMethod()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ..Tests6(sessionId), + ..Tests7(sessionId), + ..Tests8(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests6(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests7(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests8(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); + + global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSourceClassCombinedWithDataSourceMethodTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..b7757993b7 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt @@ -0,0 +1,764 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataSourceGeneratorTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 9, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "GeneratedData_Method", + TestFilePath = @"", + TestLineNumber = 9, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArgGeneratedData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method(methodArgGeneratedData)), + TestFilePath = @"", + TestLineNumber = 9, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "GeneratedData_Method", + TestFilePath = @"", + TestLineNumber = 9, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataSourceGeneratorTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::System.Int32 methodArg = methodArgGeneratedData.Item1; + global::System.String methodArg1 = methodArgGeneratedData.Item2; + global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method2(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 17, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "GeneratedData_Method2", + TestFilePath = @"", + TestLineNumber = 17, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::System.Int32 methodArg = methodArgGeneratedData.Item1; + global::System.String methodArg1 = methodArgGeneratedData.Item2; + global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method2(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 17, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "GeneratedData_Method2", + TestFilePath = @"", + TestLineNumber = 17, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new DataSourceGeneratorTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::System.Int32 methodArg = methodArgGeneratedData.Item1; + global::System.String methodArg1 = methodArgGeneratedData.Item2; + global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method3(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 25, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "GeneratedData_Method3", + TestFilePath = @"", + TestLineNumber = 25, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var methodArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = methodInfo.GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); + + var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); + + foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) + { + testMethodDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::System.Int32 classArg = classArgGeneratedData.Item1; + global::System.String classArg1 = classArgGeneratedData.Item2; + global::System.Boolean classArg2 = classArgGeneratedData.Item3; + + + var methodArgGeneratedData = methodArgGeneratedDataAccessor(); + global::System.Int32 methodArg = methodArgGeneratedData.Item1; + global::System.String methodArg1 = methodArgGeneratedData.Item2; + global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [classArg, classArg1, classArg2], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method3(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 25, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute, methodDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "GeneratedData_Method3", + TestFilePath = @"", + TestLineNumber = 25, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..7137a588bb --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt @@ -0,0 +1,247 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new EnumMemberNamesTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("A") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("B") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("C") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "SomeTest", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("A") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("B") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("C") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "SomeTest", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("A") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("B") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("C") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", + TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "SomeTest", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..cabad95aa0 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,283 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.SomeMethod()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodData)), + TestFilePath = @"", + TestLineNumber = 8, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 8, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.SomeMethod()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method2(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method2(methodData)), + TestFilePath = @"", + TestLineNumber = 15, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method2(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method2", + TestFilePath = @"", + TestLineNumber = 15, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.MethodWithBaseReturn()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_WithBaseReturn(methodData)), + TestFilePath = @"", + TestLineNumber = 22, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("MethodWithBaseReturn") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue):0", + TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)], + TestName = "DataSource_WithBaseReturn", + TestFilePath = @"", + TestLineNumber = 22, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..2f907407c3 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,182 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new EnumerableTupleDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.TupleMethod()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var methodArgTuples = global::System.TupleExtensions.ToTuple(methodData); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.NamedTupleMethod()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var methodArgTuples = global::System.TupleExtensions.ToTuple(methodData); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..e0d8179729 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt @@ -0,0 +1,188 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new GenericMethodTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.GenericMethodTests.AggregateBy_Numeric_TestData()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var methodArgTuples = global::System.TupleExtensions.ToTuple, global::System.Func, global::System.Func, global::System.Func, global::System.Collections.Generic.IEqualityComparer, global::System.Collections.Generic.IEnumerable>>(methodData); + global::System.Collections.Generic.IEnumerable methodArg = methodArgTuples.Item1; + global::System.Func methodArg1 = methodArgTuples.Item2; + global::System.Func methodArg2 = methodArgTuples.Item3; + global::System.Func methodArg3 = methodArgTuples.Item4; + global::System.Collections.Generic.IEqualityComparer methodArg4 = methodArgTuples.Item5; + global::System.Collections.Generic.IEnumerable> methodArg5 = methodArgTuples.Item6; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.GenericMethodTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AggregateBy_HasExpectedOutput(methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_Numeric_TestData") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_String_TestData") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", + TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], + TestName = "AggregateBy_HasExpectedOutput", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.GenericMethodTests.AggregateBy_String_TestData()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var methodArgTuples = global::System.TupleExtensions.ToTuple, global::System.Func, global::System.Func, global::System.Func, global::System.Collections.Generic.IEqualityComparer, global::System.Collections.Generic.IEnumerable>>(methodData); + global::System.Collections.Generic.IEnumerable methodArg = methodArgTuples.Item1; + global::System.Func methodArg1 = methodArgTuples.Item2; + global::System.Func methodArg2 = methodArgTuples.Item3; + global::System.Func methodArg3 = methodArgTuples.Item4; + global::System.Collections.Generic.IEqualityComparer methodArg4 = methodArgTuples.Item5; + global::System.Collections.Generic.IEnumerable> methodArg5 = methodArgTuples.Item6; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.GenericMethodTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AggregateBy_HasExpectedOutput(methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_Numeric_TestData") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_String_TestData") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", + TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], + TestName = "AggregateBy_HasExpectedOutput", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..e8eb65cd48 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase1.AfterAll1(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase2.AfterAll2(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase3.AfterAll3(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..2a493fac6b --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase1.BeforeAll1(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase2.BeforeAll2(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase3.BeforeAll3(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..1706a9f804 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,326 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PropertySetterTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String propertyArg = "1"; + + global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); + var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo2, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo3, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo4, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo5, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo6, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + + global::TUnit.TestProject.PropertySetterTests.StaticProperty = propertyArg6; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PropertySetterTests() + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + Property5 = propertyArg4, + Property6 = propertyArg5, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), + TestFilePath = @"", + TestLineNumber = 70, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", + TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 70, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_InheritedPropertySetterTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.InheritedPropertySetterTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String propertyArg = "1"; + + global::System.String propertyArg1 = global::TUnit.TestProject.InheritedPropertySetterTests.MethodData(); + var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo2, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo3, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo4, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo5, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo6, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + + global::TUnit.TestProject.InheritedPropertySetterTests.StaticProperty = propertyArg6; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.InheritedPropertySetterTests() + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + Property5 = propertyArg4, + Property6 = propertyArg5, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.InheritedPropertySetterTests.Test:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), + TestFilePath = @"", + TestLineNumber = 70, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +}, new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.InheritedPropertySetterTests.Test:0", + TestClass = typeof(global::TUnit.TestProject.InheritedPropertySetterTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 70, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..a7f85bc69e --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt @@ -0,0 +1,365 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.Test:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), + TestFilePath = @"", + TestLineNumber = 6, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.Test:0", + TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 6, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = global::TUnit.TestProject.TestData.Foo(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.GenericMethodDataSource(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GenericMethodDataSource(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("Foo") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.GenericMethodDataSource(System.String):0", + TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "GenericMethodDataSource", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = global::TUnit.TestProject.TestData.Foo(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.NonGenericMethodDataSource(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NonGenericMethodDataSource(methodArg)), + TestFilePath = @"", + TestLineNumber = 17, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.TestData), "Foo") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.NonGenericMethodDataSource(System.String):0", + TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "NonGenericMethodDataSource", + TestFilePath = @"", + TestLineNumber = 17, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Inherited_InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new Inherited_InheritedTestsFromDifferentProjectTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.BaseTest:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BaseTest()), + TestFilePath = @"", + TestLineNumber = 7, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.BaseTest:0", + TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "BaseTest", + TestFilePath = @"", + TestLineNumber = 7, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..7115d941ec --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt @@ -0,0 +1,5142 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MatrixTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ..Tests6(sessionId), + ..Tests7(sessionId), + ..Tests8(sessionId), + ..Tests9(sessionId), + ..Tests10(sessionId), + ..Tests11(sessionId), + ..Tests12(sessionId), + ..Tests13(sessionId), + ..Tests14(sessionId), + ..Tests15(sessionId), + ..Tests16(sessionId), + ..Tests17(sessionId), + ..Tests18(sessionId), + ..Tests19(sessionId), + ..Tests20(sessionId), + ..Tests21(sessionId), + ..Tests22(sessionId), + ..Tests23(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "A"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests6(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests7(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests8(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests9(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests10(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests11(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "B"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests12(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests13(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests14(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests15(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests16(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests17(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "C"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests18(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests19(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 1; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests20(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests21(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 2; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests22(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests23(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "D"; + global::System.Int32 methodArg1 = 3; + global::System.Boolean methodArg2 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_One", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MatrixTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ..Tests6(sessionId), + ..Tests7(sessionId), + ..Tests8(sessionId), + ..Tests9(sessionId), + ..Tests10(sessionId), + ..Tests11(sessionId), + ..Tests12(sessionId), + ..Tests13(sessionId), + ..Tests14(sessionId), + ..Tests15(sessionId), + ..Tests16(sessionId), + ..Tests17(sessionId), + ..Tests18(sessionId), + ..Tests19(sessionId), + ..Tests20(sessionId), + ..Tests21(sessionId), + ..Tests22(sessionId), + ..Tests23(sessionId), + ..Tests24(sessionId), + ..Tests25(sessionId), + ..Tests26(sessionId), + ..Tests27(sessionId), + ..Tests28(sessionId), + ..Tests29(sessionId), + ..Tests30(sessionId), + ..Tests31(sessionId), + ..Tests32(sessionId), + ..Tests33(sessionId), + ..Tests34(sessionId), + ..Tests35(sessionId), + ..Tests36(sessionId), + ..Tests37(sessionId), + ..Tests38(sessionId), + ..Tests39(sessionId), + ..Tests40(sessionId), + ..Tests41(sessionId), + ..Tests42(sessionId), + ..Tests43(sessionId), + ..Tests44(sessionId), + ..Tests45(sessionId), + ..Tests46(sessionId), + ..Tests47(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests6(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests7(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests8(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests9(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests10(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests11(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests12(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests13(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests14(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests15(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests16(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests17(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests18(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests19(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests20(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests21(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests22(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests23(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests24(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS24:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS24:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests25(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS25:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS25:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests26(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS26:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS26:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests27(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS27:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS27:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests28(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS28:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS28:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests29(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS29:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS29:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests30(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS30:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS30:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests31(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 1; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS31:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS31:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests32(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS32:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS32:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests33(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS33:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS33:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests34(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS34:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS34:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests35(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS35:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS35:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests36(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS36:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS36:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests37(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS37:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS37:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests38(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS38:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS38:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests39(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 2; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS39:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS39:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests40(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS40:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS40:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests41(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 1; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS41:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS41:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests42(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS42:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS42:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests43(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 2; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS43:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS43:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests44(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS44:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS44:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests45(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 3; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS45:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS45:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests46(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = true; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS46:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS46:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests47(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::System.Int32 methodArg1 = 3; + global::System.Int32 methodArg2 = 4; + global::System.Boolean methodArg3 = false; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS47:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS47:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], + TestName = "MatrixTest_Two", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MatrixTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::TUnit.TestProject.TestEnum methodArg1 = (global::TUnit.TestProject.TestEnum)(-1); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], + TestName = "MatrixTest_Enum", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + global::TUnit.TestProject.TestEnum methodArg1 = global::TUnit.TestProject.TestEnum.One; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], + TestName = "MatrixTest_Enum", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::TUnit.TestProject.TestEnum methodArg1 = (global::TUnit.TestProject.TestEnum)(-1); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], + TestName = "MatrixTest_Enum", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MatrixTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 2; + global::TUnit.TestProject.TestEnum methodArg1 = global::TUnit.TestProject.TestEnum.One; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MatrixTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", + TestClass = typeof(global::TUnit.TestProject.MatrixTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], + TestName = "MatrixTest_Enum", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..9bf2932304 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,947 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), + TestFilePath = @"", + TestLineNumber = 11, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method", + TestFilePath = @"", + TestLineNumber = 11, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method2(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method2(methodArg)), + TestFilePath = @"", + TestLineNumber = 18, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method2(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method2", + TestFilePath = @"", + TestLineNumber = 18, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Action methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeAction()(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method_WithAction(void System.Action()):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method_WithAction(methodArg)), + TestFilePath = @"", + TestLineNumber = 25, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeAction") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method_WithAction(void System.Action()):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Action)], + TestName = "DataSource_Method_WithAction", + TestFilePath = @"", + TestLineNumber = 25, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(5); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method3(methodArg)), + TestFilePath = @"", + TestLineNumber = 32, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = [5], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { 5 }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method3", + TestFilePath = @"", + TestLineNumber = 32, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(5 ); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method3(methodArg)), + TestFilePath = @"", + TestLineNumber = 32, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = [5], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { 5 }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method3", + TestFilePath = @"", + TestLineNumber = 32, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 5, true); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), + TestFilePath = @"", + TestLineNumber = 41, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 5, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 6, true }, +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 7, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 8, true }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method4", + TestFilePath = @"", + TestLineNumber = 41, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 6, true ); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), + TestFilePath = @"", + TestLineNumber = 41, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 5, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 6, true }, +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 7, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 8, true }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method4", + TestFilePath = @"", + TestLineNumber = 41, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 7, true); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), + TestFilePath = @"", + TestLineNumber = 41, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 5, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 6, true }, +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 7, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 8, true }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method4", + TestFilePath = @"", + TestLineNumber = 41, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 8, true ); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS3:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), + TestFilePath = @"", + TestLineNumber = 41, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 5, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 6, true }, +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = ["Hello World!", 7, true], +}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") +{ + Arguments = new global::System.Object[] { "Hello World!", 8, true }, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS3:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "DataSource_Method4", + TestFilePath = @"", + TestLineNumber = 41, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.MethodWithBaseReturn()(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_WithBaseReturn(methodArg)), + TestFilePath = @"", + TestLineNumber = 52, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("MethodWithBaseReturn") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]).ReturnType, + ParameterTypeFullNames = [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)], + TestName = "DataSource_WithBaseReturn", + TestFilePath = @"", + TestLineNumber = 52, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTestData()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTest(System.String[]):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumerableFuncArrayTest(methodData)), + TestFilePath = @"", + TestLineNumber = 58, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncArrayTestData") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTest(System.String[]):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String[])], + TestName = "EnumerableFuncArrayTest", + TestFilePath = @"", + TestLineNumber = 58, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..45e593d6c4 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,548 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MethodDataSourceDrivenWithCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.T(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.FuncT()(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.EnumerableT()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS2:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS2:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.EnumerableFuncT()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS3:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS3:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.ArrayT()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS4:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS4:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.ArrayFuncT()) + { + testMethodDataIndex++; + + var methodData = methodDataAccessor(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS5:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [], + TestMethodArguments = [methodData], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 10, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("T") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS5:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MyTest", + TestFilePath = @"", + TestLineNumber = 10, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..54d2cb3fcd --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,227 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MultipleClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1 classArg = classArgGeneratedData.Item1; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2 classArg1 = classArgGeneratedData.Item2; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3 classArg2 = classArgGeneratedData.Item3; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4 classArg3 = classArgGeneratedData.Item4; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5 classArg4 = classArgGeneratedData.Item5; + + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(classArg, classArg1, classArg2, classArg3, classArg4) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test1:0", + TestClassArguments = [classArg, classArg1, classArg2, classArg3, classArg4], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test1()), + TestFilePath = @"", + TestLineNumber = 14, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test1:0", + TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test1", + TestFilePath = @"", + TestLineNumber = 14, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new MultipleClassDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + var classArgDataGeneratorMetadata = new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Parameters, + TestClassType = testClassType, + ParameterInfos = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetConstructors().First().GetParameters(), + PropertyInfo = null, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}; + var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); + + var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); + + foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) + { + classDataIndex++; + var classArgGeneratedData = classArgGeneratedDataAccessor(); + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1 classArg = classArgGeneratedData.Item1; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2 classArg1 = classArgGeneratedData.Item2; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3 classArg2 = classArgGeneratedData.Item3; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4 classArg3 = classArgGeneratedData.Item4; + global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5 classArg4 = classArgGeneratedData.Item5; + + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(classArg, classArg1, classArg2, classArg3, classArg4) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test2:0", + TestClassArguments = [classArg, classArg1, classArg2, classArg3, classArg4], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2()), + TestFilePath = @"", + TestLineNumber = 20, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], +} ], + AssemblyAttributes = [ ], + DataAttributes = [ classDataAttribute ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test2:0", + TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test2", + TestFilePath = @"", + TestLineNumber = 20, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..2e5ab4cbe7 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt @@ -0,0 +1,92 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NameOfArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NameOfArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NameOfArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "TestName"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NameOfArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NameOfArgumentTests.TestName(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.TestName(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("TestName") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NameOfArgumentTests.TestName(System.String):0", + TestClass = typeof(global::TUnit.TestProject.NameOfArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "TestName", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..0096a643de --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt @@ -0,0 +1,337 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NullableByteArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Byte? methodArg = (global::System.Byte)1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NullableByteArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", + TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Byte?)], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Byte? methodArg = null; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NullableByteArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", + TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Byte?)], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NullableByteArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Byte methodArg = (global::System.Byte)1; + global::System.Byte? methodArg1 = (global::System.Byte)1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NullableByteArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 12, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", + TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], + TestName = "Test2", + TestFilePath = @"", + TestLineNumber = 12, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Byte methodArg = (global::System.Byte)1; + global::System.Byte? methodArg1 = null; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NullableByteArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2(methodArg, methodArg1)), + TestFilePath = @"", + TestLineNumber = 12, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", + TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], + TestName = "Test2", + TestFilePath = @"", + TestLineNumber = 12, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..8c4670a724 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt @@ -0,0 +1,547 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "Int", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Double methodArg = 1.1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), + TestFilePath = @"", + TestLineNumber = 12, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Double)], + TestName = "Double", + TestFilePath = @"", + TestLineNumber = 12, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Single methodArg = 1.1f; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), + TestFilePath = @"", + TestLineNumber = 19, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.1f) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Single)], + TestName = "Float", + TestFilePath = @"", + TestLineNumber = 19, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int64 methodArg = 1L; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), + TestFilePath = @"", + TestLineNumber = 26, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1L) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int64)], + TestName = "Long", + TestFilePath = @"", + TestLineNumber = 26, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt64 methodArg = 1UL; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), + TestFilePath = @"", + TestLineNumber = 33, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1UL) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt64)], + TestName = "ULong", + TestFilePath = @"", + TestLineNumber = 33, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt32 methodArg = 1U; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), + TestFilePath = @"", + TestLineNumber = 40, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1U) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt32)], + TestName = "UInt", + TestFilePath = @"", + TestLineNumber = 40, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt new file mode 100644 index 0000000000..8c4670a724 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt @@ -0,0 +1,547 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int32 methodArg = 1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32)], + TestName = "Int", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Double methodArg = 1.1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), + TestFilePath = @"", + TestLineNumber = 12, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Double)], + TestName = "Double", + TestFilePath = @"", + TestLineNumber = 12, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Single methodArg = 1.1f; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), + TestFilePath = @"", + TestLineNumber = 19, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1.1f) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Single)], + TestName = "Float", + TestFilePath = @"", + TestLineNumber = 19, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.Int64 methodArg = 1L; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), + TestFilePath = @"", + TestLineNumber = 26, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1L) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int64)], + TestName = "Long", + TestFilePath = @"", + TestLineNumber = 26, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt64 methodArg = 1UL; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), + TestFilePath = @"", + TestLineNumber = 33, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1UL) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt64)], + TestName = "ULong", + TestFilePath = @"", + TestLineNumber = 33, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new NumberArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.UInt32 methodArg = 1U; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.NumberArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), + TestFilePath = @"", + TestLineNumber = 40, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1U) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", + TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.UInt32)], + TestName = "UInt", + TestFilePath = @"", + TestLineNumber = 40, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..030ebc25b9 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt @@ -0,0 +1,535 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_1:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_1()), + TestFilePath = @"", + TestLineNumber = 12, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_1:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "High_1", + TestFilePath = @"", + TestLineNumber = 12, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_2:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_2()), + TestFilePath = @"", + TestLineNumber = 18, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_2:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "High_2", + TestFilePath = @"", + TestLineNumber = 18, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_3:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_3()), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.High_3:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "High_3", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_1:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Medium_1()), + TestFilePath = @"", + TestLineNumber = 30, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Medium) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_1:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Medium_1", + TestFilePath = @"", + TestLineNumber = 30, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_2:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Medium_2()), + TestFilePath = @"", + TestLineNumber = 36, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Medium) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_2:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Medium_2", + TestFilePath = @"", + TestLineNumber = 36, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PriorityFilteringTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PriorityFilteringTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Low_1:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Low_1()), + TestFilePath = @"", + TestLineNumber = 42, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Low) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PriorityFilteringTests.Low_1:0", + TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Low_1", + TestFilePath = @"", + TestLineNumber = 42, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..aa5f3cb12f --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,162 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new PropertySetterTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.String propertyArg = "1"; + + global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); + var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo2, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo3, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo4, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo5, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); + var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata +{ + Type = TUnit.Core.Enums.DataGeneratorType.Property, + TestClassType = testClassType, + ParameterInfos = null, + PropertyInfo = propertyInfo6, + TestBuilderContext = testBuilderContextAccessor, + TestSessionId = sessionId, +}).ElementAtOrDefault(0)(); + + + global::TUnit.TestProject.PropertySetterTests.StaticProperty = propertyArg6; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.PropertySetterTests() + { + Property1 = propertyArg, + Property2 = propertyArg1, + Property3 = propertyArg2, + Property4 = propertyArg3, + Property5 = propertyArg4, + Property6 = propertyArg5, + } + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), + TestFilePath = @"", + TestLineNumber = 70, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", + TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Test", + TestFilePath = @"", + TestLineNumber = 70, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..df6f45062f --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt @@ -0,0 +1,682 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new RepeatTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.One:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 1, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.One()), + TestFilePath = @"", + TestLineNumber = 6, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.RepeatAttribute(1) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.One:0", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "One", + TestFilePath = @"", + TestLineNumber = 6, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.One:1", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 1, + RepeatLimit = 1, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.One()), + TestFilePath = @"", + TestLineNumber = 6, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.RepeatAttribute(1) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.One:1", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "One", + TestFilePath = @"", + TestLineNumber = 6, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new RepeatTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Two:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 2, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), + TestFilePath = @"", + TestLineNumber = 13, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.RepeatAttribute(2) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Two:0", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Two", + TestFilePath = @"", + TestLineNumber = 13, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Two:1", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 1, + RepeatLimit = 2, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), + TestFilePath = @"", + TestLineNumber = 13, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.RepeatAttribute(2) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Two:1", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Two", + TestFilePath = @"", + TestLineNumber = 13, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Two:2", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 2, + RepeatLimit = 2, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), + TestFilePath = @"", + TestLineNumber = 13, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.RepeatAttribute(2) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Two:2", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Two", + TestFilePath = @"", + TestLineNumber = 13, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new RepeatTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Three:0", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 3, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), + TestFilePath = @"", + TestLineNumber = 20, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Three:0", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Three", + TestFilePath = @"", + TestLineNumber = 20, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Three:1", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 1, + RepeatLimit = 3, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), + TestFilePath = @"", + TestLineNumber = 20, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Three:1", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Three", + TestFilePath = @"", + TestLineNumber = 20, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Three:2", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 2, + RepeatLimit = 3, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), + TestFilePath = @"", + TestLineNumber = 20, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Three:2", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Three", + TestFilePath = @"", + TestLineNumber = 20, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.RepeatTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.RepeatTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"TUnit.TestProject.RepeatTests.Three:3", + TestClassArguments = [], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 3, + RepeatLimit = 3, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), + TestFilePath = @"", + TestLineNumber = 20, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"TUnit.TestProject.RepeatTests.Three:3", + TestClass = typeof(global::TUnit.TestProject.RepeatTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, + ParameterTypeFullNames = [], + TestName = "Three", + TestFilePath = @"", + TestLineNumber = 20, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..81ca525f1a --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt @@ -0,0 +1,135 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_STAThreadTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "BeforeTest", 0, []), + Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), + HookExecutor = new global::TUnit.Core.STAThreadExecutor(), + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_STAThreadTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "AfterTest", 0, []), + Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), + HookExecutor = new global::TUnit.Core.STAThreadExecutor(), + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..cbfd420a13 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt @@ -0,0 +1,1490 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new StringArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ..Tests6(sessionId), + ..Tests7(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = ""; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = @"\"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = @"\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests6(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests7(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = """ + Hello + World + """; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(""" + Hello + World + """) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Normal", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new StringArgumentTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ..Tests3(sessionId), + ..Tests4(sessionId), + ..Tests5(sessionId), + ..Tests6(sessionId), + ..Tests7(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = ""; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = @"\"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = @"\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests3(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests4(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests5(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests6(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = "\\\\t"; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests7(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + global::System.String methodArg = null; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.StringArgumentTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClassArguments = [], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), + TestFilePath = @"", + TestLineNumber = 24, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute("") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(@"\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") +{ + +}, new global::TUnit.Core.ArgumentsAttribute(null) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", + TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.String)], + TestName = "Nullable", + TestFilePath = @"", + TestLineNumber = 24, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..401c854288 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt @@ -0,0 +1,103 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_TestDiscoveryHookTests(); + SourceRegistrar.RegisterTestDiscoveryHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) + { + return + [ + new global::TUnit.Core.Hooks.BeforeTestDiscoveryHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "BeforeDiscovery", 0, []), + Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.BeforeDiscovery(), + HookExecutor = DefaultExecutor.Instance, + Order = 5, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(4) +{ + Order = 5, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_TestDiscoveryHookTests(); + SourceRegistrar.RegisterTestDiscoveryHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) + { + return + [ + new global::TUnit.Core.Hooks.AfterTestDiscoveryHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "AfterDiscovery", 0, []), + Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.AfterDiscovery(), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 10, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(4) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..364f9ed2d4 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,748 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DefaultTest(System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DefaultTest(cancellationToken)), + TestFilePath = @"", + TestLineNumber = 15, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DefaultTest(System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], + TestName = "DefaultTest", + TestFilePath = @"", + TestLineNumber = 15, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).BasicTest(System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BasicTest(cancellationToken)), + TestFilePath = @"", + TestLineNumber = 21, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +}, new global::TUnit.Core.CategoryAttribute("Blah") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).BasicTest(System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], + TestName = "BasicTest", + TestFilePath = @"", + TestLineNumber = 21, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).InheritedTimeoutAttribute(System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.InheritedTimeoutAttribute(cancellationToken)), + TestFilePath = @"", + TestLineNumber = 29, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.TestProject.TimeoutCancellationTokenTests.FiveSecondTimeout() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).InheritedTimeoutAttribute(System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], + TestName = "InheritedTimeoutAttribute", + TestFilePath = @"", + TestLineNumber = 29, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + global::System.Int32 methodArg = 1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 36, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.ArgumentsAttribute(1) +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "DataTest", + TestFilePath = @"", + TestLineNumber = 36, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + global::System.Int32 methodArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataSourceTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 47, + TestAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +}, new global::TUnit.Core.TestAttribute() +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataSourceTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "DataSourceTest", + TestFilePath = @"", + TestLineNumber = 47, + Exception = exception, + }); + } + return nodes; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TimeoutCancellationTokenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return + [ + ..Tests0(sessionId), + ..Tests1(sessionId), + ..Tests2(sessionId), + ]; + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + global::System.Int32 methodArg = 1; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 54, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +}, new global::TUnit.Core.CategoryAttribute("Blah") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MatrixTest", + TestFilePath = @"", + TestLineNumber = 54, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests1(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + global::System.Int32 methodArg = 2; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS1:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 54, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +}, new global::TUnit.Core.CategoryAttribute("Blah") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS1:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MatrixTest", + TestFilePath = @"", + TestLineNumber = 54, + Exception = exception, + }); + } + return nodes; + } + private global::System.Collections.Generic.List Tests2(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); + + global::System.Int32 methodArg = 3; + + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS2:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClassArguments = [classArg], + TestMethodArguments = [methodArg], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), + TestFilePath = @"", + TestLineNumber = 54, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.TimeoutAttribute(5_000) +{ + +}, new global::TUnit.Core.CategoryAttribute("Blah") +{ + +} ], + ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") +{ + +}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") +{ + +} ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS2:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", + TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], + TestName = "MatrixTest", + TestFilePath = @"", + TestLineNumber = 54, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..41b292a102 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt @@ -0,0 +1,94 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::TUnit.Core; +using global::TUnit.Core.Extensions; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class TupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + SourceRegistrar.Register(new TupleDataSourceDrivenTests()); + } + public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) + { + return Tests0(sessionId); + } + private global::System.Collections.Generic.List Tests0(string sessionId) + { + global::System.Collections.Generic.List nodes = []; + var classDataIndex = 0; + var testMethodDataIndex = 0; + try + { + var testClassType = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + + var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); + var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); + + var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.TupleDataSourceDrivenTests.TupleMethod()); + global::System.Int32 methodArg = methodArgTuples.Item1; + global::System.String methodArg1 = methodArgTuples.Item2; + global::System.Boolean methodArg2 = methodArgTuples.Item3; + var resettableClassFactoryDelegate = () => new ResettableLazy(() => + new global::TUnit.TestProject.TupleDataSourceDrivenTests() + , sessionId, testBuilderContext); + + var resettableClassFactory = resettableClassFactoryDelegate(); + + nodes.Add(new TestMetadata + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClassArguments = [], + TestMethodArguments = [methodArg, methodArg1, methodArg2], + TestClassProperties = [], + CurrentRepeatAttempt = 0, + RepeatLimit = 0, + MethodInfo = methodInfo, + ResettableClassFactory = resettableClassFactory, + TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), + TestFilePath = @"", + TestLineNumber = 5, + TestAttributes = [ new global::TUnit.Core.TestAttribute() +{ + +}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + DataAttributes = [ ], + TestBuilderContext = testBuilderContext, + }); + resettableClassFactory = resettableClassFactoryDelegate(); + testBuilderContext = new(); + testBuilderContextAccessor.Current = testBuilderContext; + } + catch (global::System.Exception exception) + { + nodes.Add(new FailedInitializationTest + { + TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", + TestClass = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], + TestName = "DataSource_TupleMethod", + TestFilePath = @"", + TestLineNumber = 5, + Exception = exception, + }); + } + return nodes; + } +} + +] \ No newline at end of file From 083728a9b5934586d754713e5317def1858b4243 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:22:20 +0000 Subject: [PATCH 49/71] MethodInfoRetriever --- ...ractTests.Concrete1.DotNet9_0.received.txt | 90 - .../AbstractTests.Concrete1.verified.txt | 4 +- ...ractTests.Concrete2.DotNet9_0.received.txt | 274 - .../AbstractTests.Concrete2.verified.txt | 12 +- .../AfterAllTests.Test.DotNet9_0.received.txt | 875 --- .../AfterAllTests.Test.verified.txt | 118 +- .../AfterTests.Test.DotNet9_0.received.txt | 875 --- .../AfterTests.Test.verified.txt | 118 +- ...mblyAfterTests.Test.DotNet9_0.received.txt | 875 --- .../AssemblyAfterTests.Test.verified.txt | 118 +- ...blyBeforeTests.Test.DotNet9_0.received.txt | 875 --- .../AssemblyBeforeTests.Test.verified.txt | 118 +- .../BasicTests.Test.DotNet9_0.received.txt | 259 - .../BasicTests.Test.verified.txt | 12 +- ...BeforeAllTests.Test.DotNet9_0.received.txt | 875 --- .../BeforeAllTests.Test.verified.txt | 118 +- .../BeforeTests.Test.DotNet9_0.received.txt | 875 --- .../BeforeTests.Test.verified.txt | 118 +- ...ArgumentsTests.Test.DotNet9_0.received.txt | 846 --- ...sAndMethodArgumentsTests.Test.verified.txt | 40 +- ...onstructorTest.Test.DotNet9_0.received.txt | 88 - .../ClassConstructorTest.Test.verified.txt | 4 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 768 --- ...assDataSourceDrivenTests.Test.verified.txt | 28 +- ...ceDrivenTests2.Test.DotNet9_0.received.txt | 399 -- ...ssDataSourceDrivenTests2.Test.verified.txt | 16 +- ...stsSharedKeyed.Test.DotNet9_0.received.txt | 215 - ...ceDrivenTestsSharedKeyed.Test.verified.txt | 8 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 396 -- ...pleDataSourceDrivenTests.Test.verified.txt | 16 +- ...reteClassTests.Test.DotNet9_0.received.txt | 274 - .../ConcreteClassTests.Test.verified.txt | 12 +- ...ArgumentsTests.Test.DotNet9_0.received.txt | 638 -- .../ConstantArgumentsTests.Test.verified.txt | 28 +- ...BaseClassTests.Test.DotNet9_0.received.txt | 92 - ...ConstantInBaseClassTests.Test.verified.txt | 4 +- ...edStringsTests.Test.DotNet9_0.received.txt | 92 - ...InterpolatedStringsTests.Test.verified.txt | 4 +- ...ataDrivenTests.Test.DotNet9_0.received.txt | 1534 ----- .../DataDrivenTests.Test.verified.txt | 72 +- ...rceMethodTests.Test.DotNet9_0.received.txt | 766 --- ...ithDataSourceMethodTests.Test.verified.txt | 36 +- ...GeneratorTests.Test.DotNet9_0.received.txt | 764 --- ...DataSourceGeneratorTests.Test.verified.txt | 24 +- ...mberNamesTests.Test.DotNet9_0.received.txt | 247 - .../EnumMemberNamesTests.Test.verified.txt | 12 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 283 - ...bleDataSourceDrivenTests.Test.verified.txt | 12 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 182 - ...pleDataSourceDrivenTests.Test.verified.txt | 8 +- ...ricMethodTests.Test.DotNet9_0.received.txt | 188 - .../GenericMethodTests.Test.verified.txt | 32 +- ...AfterEachTests.Test.DotNet9_0.received.txt | 875 --- ...obalStaticAfterEachTests.Test.verified.txt | 118 +- ...eforeEachTests.Test.DotNet9_0.received.txt | 875 --- ...balStaticBeforeEachTests.Test.verified.txt | 118 +- ...rtySetterTests.Test.DotNet9_0.received.txt | 326 -- ...ritedPropertySetterTests.Test.verified.txt | 16 +- ...ntProjectTests.Test.DotNet9_0.received.txt | 365 -- ...romDifferentProjectTests.Test.verified.txt | 16 +- .../MatrixTests.Test.DotNet9_0.received.txt | 5142 ----------------- .../MatrixTests.Test.verified.txt | 304 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 947 --- ...hodDataSourceDrivenTests.Test.verified.txt | 44 +- ...tionTokenTests.Test.DotNet9_0.received.txt | 548 -- ...thCancellationTokenTests.Test.verified.txt | 24 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 227 - ...assDataSourceDrivenTests.Test.verified.txt | 8 +- ...fArgumentTests.Test.DotNet9_0.received.txt | 92 - .../NameOfArgumentTests.Test.verified.txt | 4 +- ...eArgumentTests.Test.DotNet9_0.received.txt | 337 -- ...ullableByteArgumentTests.Test.verified.txt | 16 +- ...rArgumentTests.Test.DotNet9_0.received.txt | 547 -- .../NumberArgumentTests.Test.verified.txt | 24 +- ...rgumentTests.TestDE.DotNet9_0.received.txt | 547 -- .../NumberArgumentTests.TestDE.verified.txt | 24 +- ...FilteringTests.Test.DotNet9_0.received.txt | 535 -- .../PriorityFilteringTests.Test.verified.txt | 24 +- ...rtySetterTests.Test.DotNet9_0.received.txt | 162 - .../PropertySetterTests.Test.verified.txt | 8 +- .../RepeatTests.Test.DotNet9_0.received.txt | 682 --- .../RepeatTests.Test.verified.txt | 36 +- ...readHooksTests.Test.DotNet9_0.received.txt | 135 - .../STAThreadHooksTests.Test.verified.txt | 28 +- ...gArgumentTests.Test.DotNet9_0.received.txt | 1490 ----- .../StringArgumentTests.Test.verified.txt | 64 +- ...overyHookTests.Test.DotNet9_0.received.txt | 103 - .../TestDiscoveryHookTests.Test.verified.txt | 16 +- ...tionTokenTests.Test.DotNet9_0.received.txt | 748 --- ...utCancellationTokenTests.Test.verified.txt | 32 +- ...rceDrivenTests.Test.DotNet9_0.received.txt | 94 - ...pleDataSourceDrivenTests.Test.verified.txt | 4 +- 92 files changed, 1376 insertions(+), 29066 deletions(-) delete mode 100644 TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt deleted file mode 100644 index a020c085a6..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.DotNet9_0.received.txt +++ /dev/null @@ -1,90 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_ConcreteClass1()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass1() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AssertClassName", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt index 49bf2db425..a020c085a6 100644 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt @@ -29,7 +29,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -75,7 +75,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AssertClassName", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt deleted file mode 100644 index 1e012bce0b..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.DotNet9_0.received.txt +++ /dev/null @@ -1,274 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConcreteClass2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass2() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SecondTest()), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -}, new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "SecondTest", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_ConcreteClass2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass2() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -}, new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AssertClassName", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_ConcreteClass1()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass1() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AssertClassName", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt index d85e2235e4..1e012bce0b 100644 --- a/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt @@ -29,7 +29,7 @@ file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestS try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("SecondTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -78,7 +78,7 @@ file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestS { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("SecondTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "SecondTest", TestFilePath = @"", @@ -121,7 +121,7 @@ file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("AssertClassName", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -170,7 +170,7 @@ file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenera { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("AssertClassName", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AssertClassName", TestFilePath = @"", @@ -213,7 +213,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -259,7 +259,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AssertClassName", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 1d055a9dd1..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt index ef56fb2924..1d055a9dd1 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt @@ -44,12 +44,18 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base1).GetMethod("AfterAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -101,10 +107,16 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base1).GetMethod("AfterEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -156,12 +168,18 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base2).GetMethod("AfterAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -213,10 +231,16 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base2).GetMethod("AfterEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -268,12 +292,18 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base3).GetMethod("AfterAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -325,10 +355,16 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base3).GetMethod("AfterEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -380,12 +416,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -437,12 +479,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -494,12 +542,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -551,12 +605,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -608,10 +668,16 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("Cleanup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -663,10 +729,19 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -718,10 +793,16 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -773,10 +854,19 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 1d055a9dd1..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt index ef56fb2924..1d055a9dd1 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt @@ -44,12 +44,18 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base1).GetMethod("AfterAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -101,10 +107,16 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base1).GetMethod("AfterEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -156,12 +168,18 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base2).GetMethod("AfterAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -213,10 +231,16 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base2).GetMethod("AfterEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -268,12 +292,18 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base3).GetMethod("AfterAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -325,10 +355,16 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.Base3).GetMethod("AfterEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -380,12 +416,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -437,12 +479,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -494,12 +542,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -551,12 +605,18 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC [ new AfterClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -608,10 +668,16 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("Cleanup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -663,10 +729,19 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -718,10 +793,16 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -773,10 +854,19 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.CleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 8f845aebe8..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt index 356e64ab79..8f845aebe8 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt @@ -44,12 +44,18 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1).GetMethod("AfterAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -101,10 +107,16 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1).GetMethod("AfterEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -156,12 +168,18 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2).GetMethod("AfterAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -213,10 +231,16 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2).GetMethod("AfterEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -268,12 +292,18 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3).GetMethod("AfterAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -325,10 +355,16 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3).GetMethod("AfterEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -380,12 +416,18 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -437,12 +479,18 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -494,12 +542,18 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -551,12 +605,18 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new AfterAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -608,10 +668,16 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("Cleanup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -663,10 +729,19 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -718,10 +793,16 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -773,10 +854,19 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests).GetMethod("CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 4078cfd9c5..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt index 2352bcfd24..4078cfd9c5 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt @@ -38,12 +38,18 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1).GetMethod("BeforeAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -95,10 +101,16 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1).GetMethod("BeforeEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -150,12 +162,18 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2).GetMethod("BeforeAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -207,10 +225,16 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2).GetMethod("BeforeEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -262,12 +286,18 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3).GetMethod("BeforeAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -319,10 +349,16 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3).GetMethod("BeforeEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -374,12 +410,18 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -431,12 +473,18 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -488,12 +536,18 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -545,12 +599,18 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new BeforeAssemblyHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -602,10 +662,16 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("Setup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -657,10 +723,19 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -712,10 +787,16 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -767,10 +848,19 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 0e13e51696..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,259 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new BasicTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.BasicTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.BasicTests.SynchronousTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SynchronousTest()), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.BasicTests.SynchronousTest:0", - TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "SynchronousTest", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new BasicTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.BasicTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.BasicTests.AsynchronousTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AsynchronousTest()), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.BasicTests.AsynchronousTest:0", - TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AsynchronousTest", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new BasicTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.BasicTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.BasicTests.ValueTaskAsynchronousTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ValueTaskAsynchronousTest()), - TestFilePath = @"", - TestLineNumber = 17, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.BasicTests.ValueTaskAsynchronousTest:0", - TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "ValueTaskAsynchronousTest", - TestFilePath = @"", - TestLineNumber = 17, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.verified.txt index 9f5922b241..0e13e51696 100644 --- a/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BasicTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc try { var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = typeof(global::TUnit.TestProject.BasicTests).GetMethod("SynchronousTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -72,7 +72,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc { TestId = $"TUnit.TestProject.BasicTests.SynchronousTest:0", TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = typeof(global::TUnit.TestProject.BasicTests).GetMethod("SynchronousTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "SynchronousTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "SynchronousTest", TestFilePath = @"", @@ -115,7 +115,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc try { var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = typeof(global::TUnit.TestProject.BasicTests).GetMethod("AsynchronousTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -158,7 +158,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc { TestId = $"TUnit.TestProject.BasicTests.AsynchronousTest:0", TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = typeof(global::TUnit.TestProject.BasicTests).GetMethod("AsynchronousTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "AsynchronousTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AsynchronousTest", TestFilePath = @"", @@ -201,7 +201,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc try { var testClassType = typeof(global::TUnit.TestProject.BasicTests); - var methodInfo = typeof(global::TUnit.TestProject.BasicTests).GetMethod("ValueTaskAsynchronousTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -244,7 +244,7 @@ file partial class BasicTests : TUnit.Core.Interfaces.SourceGenerator.ITestSourc { TestId = $"TUnit.TestProject.BasicTests.ValueTaskAsynchronousTest:0", TestClass = typeof(global::TUnit.TestProject.BasicTests), - ReturnType = typeof(global::TUnit.TestProject.BasicTests).GetMethod("ValueTaskAsynchronousTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BasicTests), "ValueTaskAsynchronousTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "ValueTaskAsynchronousTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt deleted file mode 100644 index ec356791e0..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt index ee4093c9d9..ec356791e0 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt @@ -38,12 +38,18 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base1).GetMethod("BeforeAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -95,10 +101,16 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base1).GetMethod("BeforeEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -150,12 +162,18 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base2).GetMethod("BeforeAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -207,10 +225,16 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base2).GetMethod("BeforeEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -262,12 +286,18 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base3).GetMethod("BeforeAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -319,10 +349,16 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base3).GetMethod("BeforeEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -374,12 +410,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -431,12 +473,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -488,12 +536,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -545,12 +599,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -602,10 +662,16 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("Setup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -657,10 +723,19 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -712,10 +787,16 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -767,10 +848,19 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt deleted file mode 100644 index ec356791e0..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt index ee4093c9d9..ec356791e0 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt @@ -38,12 +38,18 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base1).GetMethod("BeforeAll1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -95,10 +101,16 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base1).GetMethod("BeforeEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -150,12 +162,18 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base2).GetMethod("BeforeAll2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -207,10 +225,16 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base2).GetMethod("BeforeEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -262,12 +286,18 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base3).GetMethod("BeforeAll3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -319,10 +349,16 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.Base3).GetMethod("BeforeEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -374,12 +410,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -431,12 +473,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -488,12 +536,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -545,12 +599,18 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla [ new BeforeClassHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -602,10 +662,16 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("Setup", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -657,10 +723,19 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -712,10 +787,16 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -767,10 +848,19 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.SetupTests).GetMethod("SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt deleted file mode 100644 index b58d86e94f..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,846 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "1"; - - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", - TestClassArguments = [classArg], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Simple()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Simple", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "2"; - - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", - TestClassArguments = [classArg], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Simple()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Simple", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "1"; - - - global::System.String methodArg = "3"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "WithMethodLevel", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "2"; - - - global::System.String methodArg = "3"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "WithMethodLevel", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "1"; - - - global::System.String methodArg = "4"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "WithMethodLevel", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "2"; - - - global::System.String methodArg = "4"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.WithMethodLevel(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "WithMethodLevel", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassAndMethodArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "1"; - - - global::System.String methodArg = "3"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), - TestFilePath = @"", - TestLineNumber = 16, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "IgnoreParameters", - TestFilePath = @"", - TestLineNumber = 16, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "2"; - - - global::System.String methodArg = "3"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), - TestFilePath = @"", - TestLineNumber = 16, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "IgnoreParameters", - TestFilePath = @"", - TestLineNumber = 16, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "1"; - - - global::System.String methodArg = "4"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), - TestFilePath = @"", - TestLineNumber = 16, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "IgnoreParameters", - TestFilePath = @"", - TestLineNumber = 16, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String classArg = "2"; - - - global::System.String methodArg = "4"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassAndMethodArgumentsTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IgnoreParameters(methodArg)), - TestFilePath = @"", - TestLineNumber = 16, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("3") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("4") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ArgumentsAttribute("1") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("2") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "IgnoreParameters", - TestFilePath = @"", - TestLineNumber = 16, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt index b9e69887da..b58d86e94f 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassAndMethodArgumentsTests.Test.verified.txt @@ -33,7 +33,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("Simple", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -84,7 +84,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("Simple", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Simple", TestFilePath = @"", @@ -102,7 +102,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("Simple", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -153,7 +153,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).Simple:0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("Simple", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "Simple", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Simple", TestFilePath = @"", @@ -202,7 +202,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -261,7 +261,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "WithMethodLevel", TestFilePath = @"", @@ -279,7 +279,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -338,7 +338,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "WithMethodLevel", TestFilePath = @"", @@ -356,7 +356,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -415,7 +415,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "WithMethodLevel", TestFilePath = @"", @@ -433,7 +433,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -492,7 +492,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).WithMethodLevel(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "WithMethodLevel", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "WithMethodLevel", TestFilePath = @"", @@ -541,7 +541,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -600,7 +600,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "IgnoreParameters", TestFilePath = @"", @@ -618,7 +618,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -677,7 +677,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "IgnoreParameters", TestFilePath = @"", @@ -695,7 +695,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -754,7 +754,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "IgnoreParameters", TestFilePath = @"", @@ -772,7 +772,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe try { var testClassType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -831,7 +831,7 @@ file partial class ClassAndMethodArgumentsTests : TUnit.Core.Interfaces.SourceGe { TestId = $"global::TUnit.Core.ArgumentsAttribute:{classDataIndex}:CL-ARGS1:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.ClassAndMethodArgumentsTests(System.String).IgnoreParameters(System.String):0", TestClass = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests).GetMethod("IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassAndMethodArgumentsTests), "IgnoreParameters", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "IgnoreParameters", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt deleted file mode 100644 index 82ecb6fe7a..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,88 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassConstructorTest : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassConstructorTest()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassConstructorTest); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassConstructorAttribute:{classDataIndex}:CL-CCA0:TUnit.TestProject.ClassConstructorTest(TUnit.TestProject.DummyReferenceTypeClass).Test:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassConstructorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassConstructorAttribute:{classDataIndex}:CL-CCA0:TUnit.TestProject.ClassConstructorTest(TUnit.TestProject.DummyReferenceTypeClass).Test:0", - TestClass = typeof(global::TUnit.TestProject.ClassConstructorTest), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt index 4ae457ce92..82ecb6fe7a 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassConstructorTest.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ClassConstructorTest : TUnit.Core.Interfaces.SourceGenerator. try { var testClassType = typeof(global::TUnit.TestProject.ClassConstructorTest); - var methodInfo = typeof(global::TUnit.TestProject.ClassConstructorTest).GetMethod("Test", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -73,7 +73,7 @@ file partial class ClassConstructorTest : TUnit.Core.Interfaces.SourceGenerator. { TestId = $"global::TUnit.Core.ClassConstructorAttribute:{classDataIndex}:CL-CCA0:TUnit.TestProject.ClassConstructorTest(TUnit.TestProject.DummyReferenceTypeClass).Test:0", TestClass = typeof(global::TUnit.TestProject.ClassConstructorTest), - ReturnType = typeof(global::TUnit.TestProject.ClassConstructorTest).GetMethod("Test", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassConstructorTest), "Test", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index f263d21a73..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,768 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], - TestName = "DataSource_Class", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class_Generic(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class_Generic(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 17, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class_Generic(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], - TestName = "DataSource_Class_Generic", - TestFilePath = @"", - TestLineNumber = 17, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_1_ClassDataSource(TUnit.TestProject.InitializableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_1_ClassDataSource(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_1_ClassDataSource(TUnit.TestProject.InitializableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass)], - TestName = "IsInitialized_With_1_ClassDataSource", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; - global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_2_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_2_ClassDataSources(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 31, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_2_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], - TestName = "IsInitialized_With_2_ClassDataSources", - TestFilePath = @"", - TestLineNumber = 31, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; - global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; - global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_3_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_3_ClassDataSources(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 39, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_3_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], - TestName = "IsInitialized_With_3_ClassDataSources", - TestFilePath = @"", - TestLineNumber = 39, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; - global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; - global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; - global::TUnit.TestProject.InitializableClass methodArg3 = methodArgGeneratedData.Item4; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_4_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_4_ClassDataSources(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 48, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_4_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], - TestName = "IsInitialized_With_4_ClassDataSources", - TestFilePath = @"", - TestLineNumber = 48, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::TUnit.TestProject.InitializableClass methodArg = methodArgGeneratedData.Item1; - global::TUnit.TestProject.InitializableClass methodArg1 = methodArgGeneratedData.Item2; - global::TUnit.TestProject.InitializableClass methodArg2 = methodArgGeneratedData.Item3; - global::TUnit.TestProject.InitializableClass methodArg3 = methodArgGeneratedData.Item4; - global::TUnit.TestProject.InitializableClass methodArg4 = methodArgGeneratedData.Item5; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_5_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IsInitialized_With_5_ClassDataSources(methodArg, methodArg1, methodArg2, methodArg3, methodArg4)), - TestFilePath = @"", - TestLineNumber = 58, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_5_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], - TestName = "IsInitialized_With_5_ClassDataSources", - TestFilePath = @"", - TestLineNumber = 58, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt index 5528786ae5..f263d21a73 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -93,7 +93,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], TestName = "DataSource_Class", TestFilePath = @"", @@ -136,7 +136,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -200,7 +200,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.DataSource_Class_Generic(TUnit.TestProject.Dummy.SomeAsyncDisposableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "DataSource_Class_Generic", 0, [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.Dummy.SomeAsyncDisposableClass)], TestName = "DataSource_Class_Generic", TestFilePath = @"", @@ -243,7 +243,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -307,7 +307,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_1_ClassDataSource(TUnit.TestProject.InitializableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_1_ClassDataSource", 0, [typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass)], TestName = "IsInitialized_With_1_ClassDataSource", TestFilePath = @"", @@ -350,7 +350,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -417,7 +417,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_2_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_2_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], TestName = "IsInitialized_With_2_ClassDataSources", TestFilePath = @"", @@ -460,7 +460,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -528,7 +528,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_3_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_3_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], TestName = "IsInitialized_With_3_ClassDataSources", TestFilePath = @"", @@ -571,7 +571,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -640,7 +640,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_4_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_4_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], TestName = "IsInitialized_With_4_ClassDataSources", TestFilePath = @"", @@ -683,7 +683,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -753,7 +753,7 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests.IsInitialized_With_5_ClassDataSources(TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass,TUnit.TestProject.InitializableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests).GetMethod("IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests), "IsInitialized_With_5_ClassDataSources", 0, [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass), typeof(global::TUnit.TestProject.InitializableClass)], TestName = "IsInitialized_With_5_ClassDataSources", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt deleted file mode 100644 index 2cd2dd3ed2..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,399 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", - TestClassArguments = [classArgGeneratedData], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived1()), - TestFilePath = @"", - TestLineNumber = 9, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Base_Derived1", - TestFilePath = @"", - TestLineNumber = 9, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", - TestClassArguments = [classArgGeneratedData], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived1()), - TestFilePath = @"", - TestLineNumber = 9, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Base_Derived1", - TestFilePath = @"", - TestLineNumber = 9, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTests2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", - TestClassArguments = [classArgGeneratedData], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived2()), - TestFilePath = @"", - TestLineNumber = 15, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Base_Derived2", - TestFilePath = @"", - TestLineNumber = 15, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTests2(classArgGeneratedData) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", - TestClassArguments = [classArgGeneratedData], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Base_Derived2()), - TestFilePath = @"", - TestLineNumber = 15, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Base_Derived2", - TestFilePath = @"", - TestLineNumber = 15, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt index 6ae214cf19..2cd2dd3ed2 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt @@ -33,7 +33,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -100,7 +100,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Base_Derived1", TestFilePath = @"", @@ -118,7 +118,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -185,7 +185,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived1:0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Base_Derived1", TestFilePath = @"", @@ -232,7 +232,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived2", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -299,7 +299,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived2", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Base_Derived2", TestFilePath = @"", @@ -317,7 +317,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived2", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -384,7 +384,7 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTests2(TUnit.TestProject.ClassDataSourceDrivenTests2.Base).Base_Derived2:0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetMethod("Base_Derived2", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2), "Base_Derived2", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Base_Derived2", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt deleted file mode 100644 index 533d8fd388..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,215 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTestsSharedKeyed()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class(SomeAsyncDisposableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 7, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class(SomeAsyncDisposableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], - TestName = "DataSource_Class", - TestFilePath = @"", - TestLineNumber = 7, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassDataSourceDrivenTestsSharedKeyed()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class_Generic(SomeAsyncDisposableClass):0", - TestClassArguments = [], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Class_Generic(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ClassDataSourceAttribute() -{ - Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class_Generic(SomeAsyncDisposableClass):0", - TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, - ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], - TestName = "DataSource_Class_Generic", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt index 1af0060d26..533d8fd388 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed).GetMethod("DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -93,7 +93,7 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class(SomeAsyncDisposableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed).GetMethod("DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], TestName = "DataSource_Class", TestFilePath = @"", @@ -136,7 +136,7 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces try { var testClassType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed); - var methodInfo = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed).GetMethod("DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -200,7 +200,7 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed.DataSource_Class_Generic(SomeAsyncDisposableClass):0", TestClass = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), - ReturnType = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed).GetMethod("DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassDataSourceDrivenTestsSharedKeyed), "DataSource_Class_Generic", 0, [typeof(SomeAsyncDisposableClass)]).ReturnType, ParameterTypeFullNames = [typeof(SomeAsyncDisposableClass)], TestName = "DataSource_Class_Generic", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 5fdb8c1ce3..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,396 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ClassTupleDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); - global::System.Int32 classArg = classArgTuples.Item1; - global::System.String classArg1 = classArgTuples.Item2; - global::System.Boolean classArg2 = classArgTuples.Item3; - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - - var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); - global::System.Int32 classArg = classArgTuples.Item1; - global::System.String classArg1 = classArgTuples.Item2; - global::System.Boolean classArg2 = classArgTuples.Item3; - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - - var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()()); - global::System.Int32 classArg = classArgTuples.Item1; - global::System.String classArg1 = classArgTuples.Item2; - global::System.Boolean classArg2 = classArgTuples.Item3; - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - - var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); - global::System.Int32 classArg = classArgTuples.Item1; - global::System.String classArg1 = classArgTuples.Item2; - global::System.Boolean classArg2 = classArgTuples.Item3; - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg1 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - (global::System.Int32, global::System.String, global::System.Boolean) propertyArg2 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.TupleMethod()(); - (global::System.Int32 Number, global::System.String Word, global::System.Boolean Flag) propertyArg3 = global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()(); - - var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests.NamedTupleMethod()()); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ClassTupleDataSourceDrivenTests(classArg, classArg1, classArg2) - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt index e015e81335..5fdb8c1ce3 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.Test.verified.txt @@ -35,7 +35,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -108,7 +108,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", @@ -126,7 +126,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -199,7 +199,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", @@ -217,7 +217,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -290,7 +290,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", @@ -308,7 +308,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests); - var methodInfo = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method; + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -381,7 +381,7 @@ file partial class ClassTupleDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.ClassTupleDataSourceDrivenTests(System.Int32,System.String,System.Boolean).DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), - ReturnType = ((Action)((global::TUnit.TestProject.ClassTupleDataSourceDrivenTests a0, global::System.Int32 a1, global::System.String a2, global::System.Boolean a3) => a0.DataSource_TupleMethod(a1, a2, a3))).Method.ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ClassTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 1e012bce0b..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,274 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConcreteClass2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass2() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SecondTest()), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -}, new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "SecondTest", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_ConcreteClass2()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass2() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -}, new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AssertClassName", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_ConcreteClass1()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.AbstractTests.ConcreteClass1() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AssertClassName()), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", - TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "AssertClassName", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt index d85e2235e4..1e012bce0b 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestS try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("SecondTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -78,7 +78,7 @@ file partial class ConcreteClass2 : TUnit.Core.Interfaces.SourceGenerator.ITestS { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.SecondTest:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("SecondTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "SecondTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "SecondTest", TestFilePath = @"", @@ -121,7 +121,7 @@ file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("AssertClassName", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -170,7 +170,7 @@ file partial class Inherited_ConcreteClass2 : TUnit.Core.Interfaces.SourceGenera { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass2.AssertClassName:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2).GetMethod("AssertClassName", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2), "AssertClassName", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AssertClassName", TestFilePath = @"", @@ -213,7 +213,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1); - var methodInfo = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -259,7 +259,7 @@ file partial class Inherited_ConcreteClass1 : TUnit.Core.Interfaces.SourceGenera { TestId = $"TUnit.TestProject.AbstractTests.ConcreteClass1.AssertClassName:0", TestClass = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), - ReturnType = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1).GetMethod("AssertClassName", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass1), "AssertClassName", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "AssertClassName", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 38ae14d284..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,638 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "123"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.String1(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.String1(methodArg)), - TestFilePath = @"", - TestLineNumber = 16, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("123") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.String1(System.String):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "String1", - TestFilePath = @"", - TestLineNumber = 16, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 123; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Int(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), - TestFilePath = @"", - TestLineNumber = 23, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(123) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Int(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "Int", - TestFilePath = @"", - TestLineNumber = 23, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Double methodArg = 1.23; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Double(System.Double):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), - TestFilePath = @"", - TestLineNumber = 30, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.23) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Double(System.Double):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Double)], - TestName = "Double", - TestFilePath = @"", - TestLineNumber = 30, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Single methodArg = 1.23F; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Float(System.Single):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), - TestFilePath = @"", - TestLineNumber = 37, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.23F) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Float(System.Single):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Single)], - TestName = "Float", - TestFilePath = @"", - TestLineNumber = 37, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int64 methodArg = 123L; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Long(System.Int64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), - TestFilePath = @"", - TestLineNumber = 44, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(123L) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Long(System.Int64):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int64)], - TestName = "Long", - TestFilePath = @"", - TestLineNumber = 44, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt32 methodArg = 123U; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.UInt(System.UInt32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), - TestFilePath = @"", - TestLineNumber = 51, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(123U) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.UInt(System.UInt32):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt32)], - TestName = "UInt", - TestFilePath = @"", - TestLineNumber = 51, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantArgumentsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt64 methodArg = 123UL; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.ConstantArgumentsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.ULong(System.UInt64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), - TestFilePath = @"", - TestLineNumber = 58, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(123UL) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.ULong(System.UInt64):0", - TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt64)], - TestName = "ULong", - TestFilePath = @"", - TestLineNumber = 58, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt index adb24e0908..38ae14d284 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("String1", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.String1(System.String):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("String1", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "String1", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "String1", TestFilePath = @"", @@ -120,7 +120,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Int", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -168,7 +168,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Int(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Int", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "Int", TestFilePath = @"", @@ -211,7 +211,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Double", 0, [typeof(global::System.Double)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -259,7 +259,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Double(System.Double):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Double", 0, [typeof(global::System.Double)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Double)], TestName = "Double", TestFilePath = @"", @@ -302,7 +302,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Float", 0, [typeof(global::System.Single)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -350,7 +350,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Float(System.Single):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Float", 0, [typeof(global::System.Single)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Single)], TestName = "Float", TestFilePath = @"", @@ -393,7 +393,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Long", 0, [typeof(global::System.Int64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -441,7 +441,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.Long(System.Int64):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("Long", 0, [typeof(global::System.Int64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int64)], TestName = "Long", TestFilePath = @"", @@ -484,7 +484,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -532,7 +532,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.UInt(System.UInt32):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt32)], TestName = "UInt", TestFilePath = @"", @@ -575,7 +575,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.ConstantArgumentsTests); - var methodInfo = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -623,7 +623,7 @@ file partial class ConstantArgumentsTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.ConstantArgumentsTests.ULong(System.UInt64):0", TestClass = typeof(global::TUnit.TestProject.ConstantArgumentsTests), - ReturnType = typeof(global::TUnit.TestProject.ConstantArgumentsTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.ConstantArgumentsTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt64)], TestName = "ULong", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 84ae34a537..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,92 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantInBaseClassTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantInBaseClassTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "Value"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests.SomeTest(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 13, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("Value") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests.SomeTest(System.String):0", - TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "SomeTest", - TestFilePath = @"", - TestLineNumber = 13, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt index 44ef473cf1..84ae34a537 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantInBaseClassTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ConstantInBaseClassTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests); - var methodInfo = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class ConstantInBaseClassTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests.SomeTest(System.String):0", TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), - ReturnType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantInBaseClassTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "SomeTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt deleted file mode 100644 index edc9140fb5..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,92 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class ConstantsInInterpolatedStringsTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new ConstantsInInterpolatedStringsTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = $"{"Value"}1"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests.SomeTest(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 13, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute($"{"Value"}1") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests.SomeTest(System.String):0", - TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "SomeTest", - TestFilePath = @"", - TestLineNumber = 13, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt index eb201d5662..edc9140fb5 100644 --- a/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ConstantsInInterpolatedStringsTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class ConstantsInInterpolatedStringsTests : TUnit.Core.Interfaces.S try { var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests); - var methodInfo = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class ConstantsInInterpolatedStringsTests : TUnit.Core.Interfaces.S { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests.SomeTest(System.String):0", TestClass = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), - ReturnType = typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.ConstantsInInterpolatedStringsTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "SomeTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index efa0940f14..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,1534 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.String methodArg1 = "String"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.String methodArg1 = "String2"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 3; - global::System.String methodArg1 = "String3"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(2) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(3) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::TUnit.TestProject.TestEnum methodArg = global::TUnit.TestProject.TestEnum.One; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), - TestFilePath = @"", - TestLineNumber = 23, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(-1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], - TestName = "EnumValue", - TestFilePath = @"", - TestLineNumber = 23, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::TUnit.TestProject.TestEnum methodArg = global::TUnit.TestProject.TestEnum.Two; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), - TestFilePath = @"", - TestLineNumber = 23, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(-1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], - TestName = "EnumValue", - TestFilePath = @"", - TestLineNumber = 23, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::TUnit.TestProject.TestEnum methodArg = (global::TUnit.TestProject.TestEnum)(-1); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumValue(methodArg)), - TestFilePath = @"", - TestLineNumber = 23, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.One) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::TUnit.TestProject.TestEnum.Two) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(-1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], - TestName = "EnumValue", - TestFilePath = @"", - TestLineNumber = 23, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = null; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NullValue(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NullValue(methodArg)), - TestFilePath = @"", - TestLineNumber = 32, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NullValue(System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "NullValue", - TestFilePath = @"", - TestLineNumber = 32, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = ""; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EmptyString(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EmptyString(methodArg)), - TestFilePath = @"", - TestLineNumber = 39, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EmptyString(System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "EmptyString", - TestFilePath = @"", - TestLineNumber = 39, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "Foo bar!"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NonEmptyString(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NonEmptyString(methodArg)), - TestFilePath = @"", - TestLineNumber = 46, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("Foo bar!") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NonEmptyString(System.String):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "NonEmptyString", - TestFilePath = @"", - TestLineNumber = 46, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Boolean? methodArg = null; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), - TestFilePath = @"", - TestLineNumber = 53, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(false) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(true) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Boolean?)], - TestName = "BooleanString", - TestFilePath = @"", - TestLineNumber = 53, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Boolean? methodArg = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), - TestFilePath = @"", - TestLineNumber = 53, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(false) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(true) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Boolean?)], - TestName = "BooleanString", - TestFilePath = @"", - TestLineNumber = 53, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Boolean? methodArg = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BooleanString(methodArg)), - TestFilePath = @"", - TestLineNumber = 53, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(false) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(true) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Boolean?)], - TestName = "BooleanString", - TestFilePath = @"", - TestLineNumber = 53, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Type methodArg = typeof(global::System.Object); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.Type(System.Type):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Type(methodArg)), - TestFilePath = @"", - TestLineNumber = 62, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(typeof(global::System.Object)) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.Type(System.Type):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Type)], - TestName = "Type", - TestFilePath = @"", - TestLineNumber = 62, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32[] methodArg = new[] { 1, 2, 3 }; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntegerArray(System.Int32[]):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IntegerArray(methodArg)), - TestFilePath = @"", - TestLineNumber = 69, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(new[] { 1, 2, 3 }) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntegerArray(System.Int32[]):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32[])], - TestName = "IntegerArray", - TestFilePath = @"", - TestLineNumber = 69, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::System.Int32.MaxValue; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntMaxValue(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.IntMaxValue(methodArg)), - TestFilePath = @"", - TestLineNumber = 76, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(global::System.Int32.MaxValue) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntMaxValue(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "IntMaxValue", - TestFilePath = @"", - TestLineNumber = 76, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt index bc3d1ff3f6..efa0940f14 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataDrivenTests.Test.verified.txt @@ -34,7 +34,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -88,7 +88,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method", TestFilePath = @"", @@ -106,7 +106,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -160,7 +160,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method", TestFilePath = @"", @@ -178,7 +178,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -232,7 +232,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method", TestFilePath = @"", @@ -280,7 +280,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -335,7 +335,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], TestName = "DataSource_Method", TestFilePath = @"", @@ -353,7 +353,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -408,7 +408,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], TestName = "DataSource_Method", TestFilePath = @"", @@ -426,7 +426,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -481,7 +481,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.DataSource_Method(System.Int32,System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32), typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String)], TestName = "DataSource_Method", TestFilePath = @"", @@ -529,7 +529,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -583,7 +583,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], TestName = "EnumValue", TestFilePath = @"", @@ -601,7 +601,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -655,7 +655,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], TestName = "EnumValue", TestFilePath = @"", @@ -673,7 +673,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -727,7 +727,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.EnumValue(TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EnumValue", 0, [typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.TestEnum)], TestName = "EnumValue", TestFilePath = @"", @@ -770,7 +770,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("NullValue", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -818,7 +818,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NullValue(System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("NullValue", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NullValue", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "NullValue", TestFilePath = @"", @@ -861,7 +861,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EmptyString", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -909,7 +909,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.EmptyString(System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("EmptyString", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "EmptyString", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "EmptyString", TestFilePath = @"", @@ -952,7 +952,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("NonEmptyString", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1000,7 +1000,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.NonEmptyString(System.String):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("NonEmptyString", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "NonEmptyString", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "NonEmptyString", TestFilePath = @"", @@ -1048,7 +1048,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1102,7 +1102,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Boolean?)], TestName = "BooleanString", TestFilePath = @"", @@ -1120,7 +1120,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1174,7 +1174,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Boolean?)], TestName = "BooleanString", TestFilePath = @"", @@ -1192,7 +1192,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1246,7 +1246,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.DataDrivenTests.BooleanString(System.Boolean?):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "BooleanString", 0, [typeof(global::System.Boolean?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Boolean?)], TestName = "BooleanString", TestFilePath = @"", @@ -1289,7 +1289,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("Type", 0, [typeof(global::System.Type)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1337,7 +1337,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.Type(System.Type):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("Type", 0, [typeof(global::System.Type)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "Type", 0, [typeof(global::System.Type)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Type)], TestName = "Type", TestFilePath = @"", @@ -1380,7 +1380,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("IntegerArray", 0, [typeof(global::System.Int32[])]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1428,7 +1428,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntegerArray(System.Int32[]):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("IntegerArray", 0, [typeof(global::System.Int32[])]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntegerArray", 0, [typeof(global::System.Int32[])]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32[])], TestName = "IntegerArray", TestFilePath = @"", @@ -1471,7 +1471,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest try { var testClassType = typeof(global::TUnit.TestProject.DataDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("IntMaxValue", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1519,7 +1519,7 @@ file partial class DataDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITest { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.DataDrivenTests.IntMaxValue(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.DataDrivenTests).GetMethod("IntMaxValue", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataDrivenTests), "IntMaxValue", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "IntMaxValue", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 06be90d647..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,766 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataSourceClassCombinedWithDataSourceMethod()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ..Tests6(sessionId), - ..Tests7(sessionId), - ..Tests8(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.One(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Two(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests6(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.One(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests7(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Two(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests8(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.CommonTestData.Three(); - - global::System.Int32 methodArg = global::TUnit.TestProject.CommonTestData.Three(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceClassCombinedWithDataSourceMethodTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "One") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Two") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.CommonTestData), "Three") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSourceClassCombinedWithDataSourceMethodTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt index 72aa8eac14..06be90d647 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt @@ -40,7 +40,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -103,7 +103,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -121,7 +121,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -184,7 +184,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -202,7 +202,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -265,7 +265,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -283,7 +283,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -346,7 +346,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -364,7 +364,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -427,7 +427,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -445,7 +445,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -508,7 +508,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -526,7 +526,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -589,7 +589,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -607,7 +607,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -670,7 +670,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS1:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", @@ -688,7 +688,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte try { var testClassType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -751,7 +751,7 @@ file partial class DataSourceClassCombinedWithDataSourceMethod : TUnit.Core.Inte { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS2:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod(System.Int32).DataSourceClassCombinedWithDataSourceMethodTest(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), - ReturnType = typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod).GetMethod("DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceClassCombinedWithDataSourceMethod), "DataSourceClassCombinedWithDataSourceMethodTest", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSourceClassCombinedWithDataSourceMethodTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt deleted file mode 100644 index b7757993b7..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,764 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataSourceGeneratorTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 9, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "GeneratedData_Method", - TestFilePath = @"", - TestLineNumber = 9, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArgGeneratedData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method(methodArgGeneratedData)), - TestFilePath = @"", - TestLineNumber = 9, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "GeneratedData_Method", - TestFilePath = @"", - TestLineNumber = 9, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataSourceGeneratorTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::System.Int32 methodArg = methodArgGeneratedData.Item1; - global::System.String methodArg1 = methodArgGeneratedData.Item2; - global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method2(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 17, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "GeneratedData_Method2", - TestFilePath = @"", - TestLineNumber = 17, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::System.Int32 methodArg = methodArgGeneratedData.Item1; - global::System.String methodArg1 = methodArgGeneratedData.Item2; - global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method2(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 17, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "GeneratedData_Method2", - TestFilePath = @"", - TestLineNumber = 17, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new DataSourceGeneratorTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::System.Int32 methodArg = methodArgGeneratedData.Item1; - global::System.String methodArg1 = methodArgGeneratedData.Item2; - global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method3(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 25, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "GeneratedData_Method3", - TestFilePath = @"", - TestLineNumber = 25, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var methodArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = methodInfo.GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); - - var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); - - foreach (var methodArgGeneratedDataAccessor in methodArgGeneratedDataArray) - { - testMethodDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::System.Int32 classArg = classArgGeneratedData.Item1; - global::System.String classArg1 = classArgGeneratedData.Item2; - global::System.Boolean classArg2 = classArgGeneratedData.Item3; - - - var methodArgGeneratedData = methodArgGeneratedDataAccessor(); - global::System.Int32 methodArg = methodArgGeneratedData.Item1; - global::System.String methodArg1 = methodArgGeneratedData.Item2; - global::System.Boolean methodArg2 = methodArgGeneratedData.Item3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.DataSourceGeneratorTests(classArg, classArg1, classArg2) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [classArg, classArg1, classArg2], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GeneratedData_Method3(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 25, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -}, new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute, methodDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "GeneratedData_Method3", - TestFilePath = @"", - TestLineNumber = 25, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt index 562e1573c8..b7757993b7 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt @@ -33,7 +33,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -125,7 +125,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "GeneratedData_Method", TestFilePath = @"", @@ -143,7 +143,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -235,7 +235,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "GeneratedData_Method", TestFilePath = @"", @@ -282,7 +282,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -378,7 +378,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "GeneratedData_Method2", TestFilePath = @"", @@ -396,7 +396,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -492,7 +492,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method2(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method2", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "GeneratedData_Method2", TestFilePath = @"", @@ -539,7 +539,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -635,7 +635,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "GeneratedData_Method3", TestFilePath = @"", @@ -653,7 +653,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera try { var testClassType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests); - var methodInfo = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -749,7 +749,7 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera { TestId = $"global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{classDataIndex}:CL-GAC0:global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute:{testMethodDataIndex}:TL-GAC0:TUnit.TestProject.DataSourceGeneratorTests(System.Int32,System.String,System.Boolean).GeneratedData_Method3(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.DataSourceGeneratorTests), - ReturnType = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetMethod("GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.DataSourceGeneratorTests), "GeneratedData_Method3", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "GeneratedData_Method3", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 7137a588bb..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,247 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new EnumMemberNamesTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("A") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("B") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("C") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "SomeTest", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("A") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("B") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("C") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "SomeTest", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.SomeTest(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("A") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("B") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("C") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", - TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "SomeTest", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt index 6c4c098295..7137a588bb 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumMemberNamesTests.Test.verified.txt @@ -34,7 +34,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. try { var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -88,7 +88,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "SomeTest", TestFilePath = @"", @@ -106,7 +106,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. try { var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -160,7 +160,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "SomeTest", TestFilePath = @"", @@ -178,7 +178,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. try { var testClassType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests); - var methodInfo = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -232,7 +232,7 @@ file partial class EnumMemberNamesTests : TUnit.Core.Interfaces.SourceGenerator. { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.Bugs._1432.EnumMemberNamesTests.SomeTest(System.String):0", TestClass = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), - ReturnType = typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests).GetMethod("SomeTest", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.Bugs._1432.EnumMemberNamesTests), "SomeTest", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "SomeTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index cabad95aa0..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,283 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.SomeMethod()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodData)), - TestFilePath = @"", - TestLineNumber = 8, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 8, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.SomeMethod()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method2(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method2(methodData)), - TestFilePath = @"", - TestLineNumber = 15, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method2(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method2", - TestFilePath = @"", - TestLineNumber = 15, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new EnumerableDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableDataSourceDrivenTests.MethodWithBaseReturn()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.EnumerableDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_WithBaseReturn(methodData)), - TestFilePath = @"", - TestLineNumber = 22, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("MethodWithBaseReturn") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue):0", - TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)], - TestName = "DataSource_WithBaseReturn", - TestFilePath = @"", - TestLineNumber = 22, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt index 221e9be00e..cabad95aa0 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableDataSourceDrivenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -80,7 +80,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method", TestFilePath = @"", @@ -123,7 +123,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_Method2", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -174,7 +174,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_Method2(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method2", TestFilePath = @"", @@ -217,7 +217,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc try { var testClassType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -268,7 +268,7 @@ file partial class EnumerableDataSourceDrivenTests : TUnit.Core.Interfaces.Sourc { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue):0", TestClass = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests).GetMethod("DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.EnumerableDataSourceDrivenTests.BaseValue)], TestName = "DataSource_WithBaseReturn", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 2f907407c3..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,182 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new EnumerableTupleDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.TupleMethod()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var methodArgTuples = global::System.TupleExtensions.ToTuple(methodData); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.NamedTupleMethod()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var methodArgTuples = global::System.TupleExtensions.ToTuple(methodData); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("NamedTupleMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt index 78edbd79c8..2f907407c3 100644 --- a/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/EnumerableTupleDataSourceDrivenTests.Test.verified.txt @@ -33,7 +33,7 @@ file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces. try { var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -91,7 +91,7 @@ file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces. { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", @@ -109,7 +109,7 @@ file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces. try { var testClassType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -167,7 +167,7 @@ file partial class EnumerableTupleDataSourceDrivenTests : TUnit.Core.Interfaces. { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.EnumerableTupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.EnumerableTupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt deleted file mode 100644 index e0d8179729..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,188 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new GenericMethodTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.GenericMethodTests.AggregateBy_Numeric_TestData()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var methodArgTuples = global::System.TupleExtensions.ToTuple, global::System.Func, global::System.Func, global::System.Func, global::System.Collections.Generic.IEqualityComparer, global::System.Collections.Generic.IEnumerable>>(methodData); - global::System.Collections.Generic.IEnumerable methodArg = methodArgTuples.Item1; - global::System.Func methodArg1 = methodArgTuples.Item2; - global::System.Func methodArg2 = methodArgTuples.Item3; - global::System.Func methodArg3 = methodArgTuples.Item4; - global::System.Collections.Generic.IEqualityComparer methodArg4 = methodArgTuples.Item5; - global::System.Collections.Generic.IEnumerable> methodArg5 = methodArgTuples.Item6; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.GenericMethodTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AggregateBy_HasExpectedOutput(methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_Numeric_TestData") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_String_TestData") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", - TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], - TestName = "AggregateBy_HasExpectedOutput", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.GenericMethodTests.AggregateBy_String_TestData()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var methodArgTuples = global::System.TupleExtensions.ToTuple, global::System.Func, global::System.Func, global::System.Func, global::System.Collections.Generic.IEqualityComparer, global::System.Collections.Generic.IEnumerable>>(methodData); - global::System.Collections.Generic.IEnumerable methodArg = methodArgTuples.Item1; - global::System.Func methodArg1 = methodArgTuples.Item2; - global::System.Func methodArg2 = methodArgTuples.Item3; - global::System.Func methodArg3 = methodArgTuples.Item4; - global::System.Collections.Generic.IEqualityComparer methodArg4 = methodArgTuples.Item5; - global::System.Collections.Generic.IEnumerable> methodArg5 = methodArgTuples.Item6; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.GenericMethodTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.AggregateBy_HasExpectedOutput(methodArg, methodArg1, methodArg2, methodArg3, methodArg4, methodArg5)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_Numeric_TestData") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("AggregateBy_String_TestData") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", - TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], - TestName = "AggregateBy_HasExpectedOutput", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt index 90b4bd1b13..e0d8179729 100644 --- a/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt @@ -33,13 +33,7 @@ file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.IT try { var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); - var methodInfo = typeof(global::TUnit.TestProject.GenericMethodTests) - .GetMethods() - .Where(method => method.IsPublic) - .Where(method => method.Name == "AggregateBy_HasExpectedOutput") - .Where(method => method.GetParameters().Length == 6) - .Where(method => method.GetGenericArguments().Length == 3) - .First(); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -100,13 +94,7 @@ file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.IT { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), - ReturnType = typeof(global::TUnit.TestProject.GenericMethodTests) - .GetMethods() - .Where(method => method.IsPublic) - .Where(method => method.Name == "AggregateBy_HasExpectedOutput") - .Where(method => method.GetParameters().Length == 6) - .Where(method => method.GetGenericArguments().Length == 3) - .First().ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], TestName = "AggregateBy_HasExpectedOutput", TestFilePath = @"", @@ -124,13 +112,7 @@ file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.IT try { var testClassType = typeof(global::TUnit.TestProject.GenericMethodTests); - var methodInfo = typeof(global::TUnit.TestProject.GenericMethodTests) - .GetMethods() - .Where(method => method.IsPublic) - .Where(method => method.Name == "AggregateBy_HasExpectedOutput") - .Where(method => method.GetParameters().Length == 6) - .Where(method => method.GetGenericArguments().Length == 3) - .First(); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -191,13 +173,7 @@ file partial class GenericMethodTests : TUnit.Core.Interfaces.SourceGenerator.IT { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS1:{testMethodDataIndex}:TUnit.TestProject.GenericMethodTests.AggregateBy_HasExpectedOutput(System.Collections.Generic.IEnumerable,TKey System.Func(TSource),TAccumulate System.Func(TKey),TAccumulate System.Func(TAccumulate, TSource),System.Collections.Generic.IEqualityComparer,System.Collections.Generic.IEnumerable>):0", TestClass = typeof(global::TUnit.TestProject.GenericMethodTests), - ReturnType = typeof(global::TUnit.TestProject.GenericMethodTests) - .GetMethods() - .Where(method => method.IsPublic) - .Where(method => method.Name == "AggregateBy_HasExpectedOutput") - .Where(method => method.GetParameters().Length == 6) - .Where(method => method.GetGenericArguments().Length == 3) - .First().ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.GenericMethodTests), "AggregateBy_HasExpectedOutput", 3, [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Collections.Generic.IEnumerable), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Func), typeof(global::System.Collections.Generic.IEqualityComparer), typeof(global::System.Collections.Generic.IEnumerable>)], TestName = "AggregateBy_HasExpectedOutput", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt deleted file mode 100644 index e8eb65cd48..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase1.AfterAll1(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase2.AfterAll2(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase3.AfterAll3(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt index 50c5d86997..e8eb65cd48 100644 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt @@ -44,10 +44,16 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase1).GetMethod("AfterEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -99,10 +105,16 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase2).GetMethod("AfterEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -154,10 +166,16 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase3).GetMethod("AfterEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -209,10 +227,16 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("CleanUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -264,10 +288,19 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -319,10 +352,16 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -374,10 +413,19 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -417,12 +465,18 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase1).GetMethod("AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase1.AfterAll1(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -474,12 +528,18 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase2).GetMethod("AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase2.AfterAll2(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -531,12 +591,18 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalBase3).GetMethod("AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase3.AfterAll3(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -588,12 +654,18 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -645,12 +717,18 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -702,12 +780,18 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -759,12 +843,18 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera [ new AfterTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests).GetMethod("AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 2a493fac6b..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase1.BeforeAll1(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase2.BeforeAll2(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase3.BeforeAll3(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt index e8bb9712ec..2a493fac6b 100644 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt @@ -38,10 +38,16 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1).GetMethod("BeforeEach1", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeEach1", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -93,10 +99,16 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2).GetMethod("BeforeEach2", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeEach2", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -148,10 +160,16 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3).GetMethod("BeforeEach3", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeEach3", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -203,10 +221,16 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("SetUp", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, []), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -258,10 +282,19 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -313,10 +346,16 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -368,10 +407,19 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -411,12 +459,18 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1).GetMethod("BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase1.BeforeAll1(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -468,12 +522,18 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2).GetMethod("BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase2.BeforeAll2(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -525,12 +585,18 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3).GetMethod("BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase3.BeforeAll3(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -582,12 +648,18 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -639,12 +711,18 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -696,12 +774,18 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -753,12 +837,18 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato [ new BeforeTestHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests).GetMethod("BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 1706a9f804..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,326 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PropertySetterTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String propertyArg = "1"; - - global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); - var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); - var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo2, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); - var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo3, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); - var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo4, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); - var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo5, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); - var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo6, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - - global::TUnit.TestProject.PropertySetterTests.StaticProperty = propertyArg6; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PropertySetterTests() - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - Property5 = propertyArg4, - Property6 = propertyArg5, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), - TestFilePath = @"", - TestLineNumber = 70, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", - TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 70, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_InheritedPropertySetterTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.InheritedPropertySetterTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String propertyArg = "1"; - - global::System.String propertyArg1 = global::TUnit.TestProject.InheritedPropertySetterTests.MethodData(); - var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); - var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo2, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); - var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo3, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); - var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo4, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); - var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo5, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); - var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo6, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - - global::TUnit.TestProject.InheritedPropertySetterTests.StaticProperty = propertyArg6; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.InheritedPropertySetterTests() - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - Property5 = propertyArg4, - Property6 = propertyArg5, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.InheritedPropertySetterTests.Test:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), - TestFilePath = @"", - TestLineNumber = 70, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -}, new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.InheritedPropertySetterTests.Test:0", - TestClass = typeof(global::TUnit.TestProject.InheritedPropertySetterTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 70, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt index 7b72b4f27f..1706a9f804 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); - var methodInfo = typeof(global::TUnit.TestProject.PropertySetterTests).GetMethod("Test", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -124,7 +124,7 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I ResettableClassFactory = resettableClassFactory, TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, TestAttributes = [ new global::TUnit.Core.TestAttribute() { @@ -147,11 +147,11 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), - ReturnType = typeof(global::TUnit.TestProject.PropertySetterTests).GetMethod("Test", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test", TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, Exception = exception, }); } @@ -190,7 +190,7 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface try { var testClassType = typeof(global::TUnit.TestProject.InheritedPropertySetterTests); - var methodInfo = typeof(global::TUnit.TestProject.InheritedPropertySetterTests).GetMethod("Test", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -285,7 +285,7 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface ResettableClassFactory = resettableClassFactory, TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, TestAttributes = [ new global::TUnit.Core.TestAttribute() { @@ -311,11 +311,11 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface { TestId = $"TUnit.TestProject.InheritedPropertySetterTests.Test:0", TestClass = typeof(global::TUnit.TestProject.InheritedPropertySetterTests), - ReturnType = typeof(global::TUnit.TestProject.InheritedPropertySetterTests).GetMethod("Test", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedPropertySetterTests), "Test", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test", TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, Exception = exception, }); } diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt deleted file mode 100644 index a7f85bc69e..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,365 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.Test:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), - TestFilePath = @"", - TestLineNumber = 6, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.Test:0", - TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 6, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = global::TUnit.TestProject.TestData.Foo(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.GenericMethodDataSource(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.GenericMethodDataSource(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("Foo") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.GenericMethodDataSource(System.String):0", - TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "GenericMethodDataSource", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new InheritedTestsFromDifferentProjectTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = global::TUnit.TestProject.TestData.Foo(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.NonGenericMethodDataSource(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.NonGenericMethodDataSource(methodArg)), - TestFilePath = @"", - TestLineNumber = 17, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute(typeof(global::TUnit.TestProject.TestData), "Foo") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.NonGenericMethodDataSource(System.String):0", - TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "NonGenericMethodDataSource", - TestFilePath = @"", - TestLineNumber = 17, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Inherited_InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new Inherited_InheritedTestsFromDifferentProjectTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.BaseTest:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BaseTest()), - TestFilePath = @"", - TestLineNumber = 7, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.InheritsTestsAttribute() -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.BaseTest:0", - TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "BaseTest", - TestFilePath = @"", - TestLineNumber = 7, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt index 467866eea1..a7f85bc69e 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritedTestsFromDifferentProjectTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac try { var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("Test", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -75,7 +75,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac { TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.Test:0", TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("Test", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "Test", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test", TestFilePath = @"", @@ -118,7 +118,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac try { var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("GenericMethodDataSource", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -168,7 +168,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.GenericMethodDataSource(System.String):0", TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("GenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "GenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "GenericMethodDataSource", TestFilePath = @"", @@ -211,7 +211,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac try { var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("NonGenericMethodDataSource", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -261,7 +261,7 @@ file partial class InheritedTestsFromDifferentProjectTests : TUnit.Core.Interfac { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.InheritedTestsFromDifferentProjectTests.NonGenericMethodDataSource(System.String):0", TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("NonGenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "NonGenericMethodDataSource", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "NonGenericMethodDataSource", TestFilePath = @"", @@ -304,7 +304,7 @@ file partial class Inherited_InheritedTestsFromDifferentProjectTests : TUnit.Cor try { var testClassType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests); - var methodInfo = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("BaseTest", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -350,7 +350,7 @@ file partial class Inherited_InheritedTestsFromDifferentProjectTests : TUnit.Cor { TestId = $"TUnit.TestProject.InheritedTestsFromDifferentProjectTests.BaseTest:0", TestClass = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), - ReturnType = typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests).GetMethod("BaseTest", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.InheritedTestsFromDifferentProjectTests), "BaseTest", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "BaseTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 7115d941ec..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,5142 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MatrixTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ..Tests6(sessionId), - ..Tests7(sessionId), - ..Tests8(sessionId), - ..Tests9(sessionId), - ..Tests10(sessionId), - ..Tests11(sessionId), - ..Tests12(sessionId), - ..Tests13(sessionId), - ..Tests14(sessionId), - ..Tests15(sessionId), - ..Tests16(sessionId), - ..Tests17(sessionId), - ..Tests18(sessionId), - ..Tests19(sessionId), - ..Tests20(sessionId), - ..Tests21(sessionId), - ..Tests22(sessionId), - ..Tests23(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "A"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests6(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests7(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests8(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests9(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests10(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests11(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "B"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests12(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests13(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests14(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests15(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests16(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests17(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "C"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests18(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests19(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 1; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests20(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests21(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 2; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests22(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests23(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "D"; - global::System.Int32 methodArg1 = 3; - global::System.Boolean methodArg2 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_One(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_One", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MatrixTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ..Tests6(sessionId), - ..Tests7(sessionId), - ..Tests8(sessionId), - ..Tests9(sessionId), - ..Tests10(sessionId), - ..Tests11(sessionId), - ..Tests12(sessionId), - ..Tests13(sessionId), - ..Tests14(sessionId), - ..Tests15(sessionId), - ..Tests16(sessionId), - ..Tests17(sessionId), - ..Tests18(sessionId), - ..Tests19(sessionId), - ..Tests20(sessionId), - ..Tests21(sessionId), - ..Tests22(sessionId), - ..Tests23(sessionId), - ..Tests24(sessionId), - ..Tests25(sessionId), - ..Tests26(sessionId), - ..Tests27(sessionId), - ..Tests28(sessionId), - ..Tests29(sessionId), - ..Tests30(sessionId), - ..Tests31(sessionId), - ..Tests32(sessionId), - ..Tests33(sessionId), - ..Tests34(sessionId), - ..Tests35(sessionId), - ..Tests36(sessionId), - ..Tests37(sessionId), - ..Tests38(sessionId), - ..Tests39(sessionId), - ..Tests40(sessionId), - ..Tests41(sessionId), - ..Tests42(sessionId), - ..Tests43(sessionId), - ..Tests44(sessionId), - ..Tests45(sessionId), - ..Tests46(sessionId), - ..Tests47(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests6(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests7(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests8(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests9(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests10(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests11(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests12(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests13(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests14(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests15(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests16(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests17(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests18(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests19(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests20(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests21(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests22(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests23(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests24(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS24:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS24:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests25(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS25:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS25:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests26(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS26:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS26:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests27(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS27:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS27:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests28(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS28:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS28:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests29(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS29:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS29:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests30(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS30:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS30:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests31(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 1; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS31:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS31:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests32(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS32:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS32:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests33(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS33:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS33:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests34(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS34:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS34:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests35(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS35:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS35:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests36(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS36:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS36:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests37(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS37:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS37:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests38(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS38:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS38:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests39(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 2; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS39:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS39:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests40(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS40:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS40:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests41(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 1; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS41:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS41:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests42(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS42:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS42:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests43(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 2; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS43:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS43:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests44(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS44:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS44:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests45(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 3; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS45:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS45:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests46(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = true; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS46:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS46:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests47(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::System.Int32 methodArg1 = 3; - global::System.Int32 methodArg2 = 4; - global::System.Boolean methodArg3 = false; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS47:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2, methodArg3], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Two(methodArg, methodArg1, methodArg2, methodArg3)), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS47:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], - TestName = "MatrixTest_Two", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MatrixTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::TUnit.TestProject.TestEnum methodArg1 = (global::TUnit.TestProject.TestEnum)(-1); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], - TestName = "MatrixTest_Enum", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - global::TUnit.TestProject.TestEnum methodArg1 = global::TUnit.TestProject.TestEnum.One; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], - TestName = "MatrixTest_Enum", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::TUnit.TestProject.TestEnum methodArg1 = (global::TUnit.TestProject.TestEnum)(-1); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], - TestName = "MatrixTest_Enum", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 2; - global::TUnit.TestProject.TestEnum methodArg1 = global::TUnit.TestProject.TestEnum.One; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MatrixTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest_Enum(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", - TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], - TestName = "MatrixTest_Enum", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt index 9f65e00f06..7115d941ec 100644 --- a/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MatrixTests.Test.verified.txt @@ -55,7 +55,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -102,7 +102,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -120,7 +120,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -167,7 +167,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -185,7 +185,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -232,7 +232,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -250,7 +250,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -297,7 +297,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -315,7 +315,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -362,7 +362,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -380,7 +380,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -427,7 +427,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -445,7 +445,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -492,7 +492,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -510,7 +510,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -557,7 +557,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -575,7 +575,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -622,7 +622,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -640,7 +640,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -687,7 +687,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -705,7 +705,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -752,7 +752,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -770,7 +770,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -817,7 +817,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -835,7 +835,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -882,7 +882,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -900,7 +900,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -947,7 +947,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -965,7 +965,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1012,7 +1012,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1030,7 +1030,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1077,7 +1077,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1095,7 +1095,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1142,7 +1142,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1160,7 +1160,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1207,7 +1207,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1225,7 +1225,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1272,7 +1272,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1290,7 +1290,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1337,7 +1337,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1355,7 +1355,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1402,7 +1402,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1420,7 +1420,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1467,7 +1467,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1485,7 +1485,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1532,7 +1532,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1550,7 +1550,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1597,7 +1597,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_One(System.String,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_One", 0, [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_One", TestFilePath = @"", @@ -1690,7 +1690,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1738,7 +1738,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -1756,7 +1756,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1804,7 +1804,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -1822,7 +1822,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1870,7 +1870,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -1888,7 +1888,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1936,7 +1936,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -1954,7 +1954,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2002,7 +2002,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS4:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2020,7 +2020,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2068,7 +2068,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS5:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2086,7 +2086,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2134,7 +2134,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS6:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2152,7 +2152,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2200,7 +2200,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS7:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2218,7 +2218,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2266,7 +2266,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS8:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2284,7 +2284,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2332,7 +2332,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS9:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2350,7 +2350,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2398,7 +2398,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS10:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2416,7 +2416,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2464,7 +2464,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS11:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2482,7 +2482,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2530,7 +2530,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS12:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2548,7 +2548,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2596,7 +2596,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS13:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2614,7 +2614,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2662,7 +2662,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS14:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2680,7 +2680,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2728,7 +2728,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS15:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2746,7 +2746,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2794,7 +2794,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS16:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2812,7 +2812,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2860,7 +2860,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS17:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2878,7 +2878,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2926,7 +2926,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS18:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -2944,7 +2944,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -2992,7 +2992,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS19:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3010,7 +3010,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3058,7 +3058,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS20:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3076,7 +3076,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3124,7 +3124,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS21:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3142,7 +3142,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3190,7 +3190,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS22:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3208,7 +3208,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3256,7 +3256,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS23:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3274,7 +3274,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3322,7 +3322,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS24:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3340,7 +3340,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3388,7 +3388,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS25:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3406,7 +3406,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3454,7 +3454,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS26:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3472,7 +3472,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3520,7 +3520,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS27:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3538,7 +3538,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3586,7 +3586,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS28:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3604,7 +3604,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3652,7 +3652,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS29:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3670,7 +3670,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3718,7 +3718,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS30:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3736,7 +3736,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3784,7 +3784,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS31:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3802,7 +3802,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3850,7 +3850,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS32:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3868,7 +3868,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3916,7 +3916,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS33:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -3934,7 +3934,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -3982,7 +3982,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS34:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4000,7 +4000,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4048,7 +4048,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS35:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4066,7 +4066,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4114,7 +4114,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS36:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4132,7 +4132,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4180,7 +4180,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS37:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4198,7 +4198,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4246,7 +4246,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS38:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4264,7 +4264,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4312,7 +4312,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS39:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4330,7 +4330,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4378,7 +4378,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS40:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4396,7 +4396,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4444,7 +4444,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS41:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4462,7 +4462,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4510,7 +4510,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS42:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4528,7 +4528,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4576,7 +4576,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS43:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4594,7 +4594,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4642,7 +4642,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS44:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4660,7 +4660,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4708,7 +4708,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS45:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4726,7 +4726,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4774,7 +4774,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS46:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4792,7 +4792,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4840,7 +4840,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS47:TUnit.TestProject.MatrixTests.MatrixTest_Two(System.Int32,System.Int32,System.Int32,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Two", 0, [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Int32), typeof(global::System.Boolean)], TestName = "MatrixTest_Two", TestFilePath = @"", @@ -4889,7 +4889,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4935,7 +4935,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS0:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], TestName = "MatrixTest_Enum", TestFilePath = @"", @@ -4953,7 +4953,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -4999,7 +4999,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS1:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], TestName = "MatrixTest_Enum", TestFilePath = @"", @@ -5017,7 +5017,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -5063,7 +5063,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS2:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], TestName = "MatrixTest_Enum", TestFilePath = @"", @@ -5081,7 +5081,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.MatrixTests); - var methodInfo = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -5127,7 +5127,7 @@ file partial class MatrixTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TL-ARGS3:TUnit.TestProject.MatrixTests.MatrixTest_Enum(System.Int32,TUnit.TestProject.TestEnum):0", TestClass = typeof(global::TUnit.TestProject.MatrixTests), - ReturnType = typeof(global::TUnit.TestProject.MatrixTests).GetMethod("MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MatrixTests), "MatrixTest_Enum", 0, [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::TUnit.TestProject.TestEnum)], TestName = "MatrixTest_Enum", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 9bf2932304..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,947 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method(methodArg)), - TestFilePath = @"", - TestLineNumber = 11, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method", - TestFilePath = @"", - TestLineNumber = 11, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method2(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method2(methodArg)), - TestFilePath = @"", - TestLineNumber = 18, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method2(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method2", - TestFilePath = @"", - TestLineNumber = 18, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Action methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeAction()(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method_WithAction(void System.Action()):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method_WithAction(methodArg)), - TestFilePath = @"", - TestLineNumber = 25, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeAction") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method_WithAction(void System.Action()):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Action)], - TestName = "DataSource_Method_WithAction", - TestFilePath = @"", - TestLineNumber = 25, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(5); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method3(methodArg)), - TestFilePath = @"", - TestLineNumber = 32, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = [5], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { 5 }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method3", - TestFilePath = @"", - TestLineNumber = 32, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod(5 ); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method3(methodArg)), - TestFilePath = @"", - TestLineNumber = 32, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = [5], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { 5 }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method3", - TestFilePath = @"", - TestLineNumber = 32, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 5, true); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), - TestFilePath = @"", - TestLineNumber = 41, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 5, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 6, true }, -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 7, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 8, true }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method4", - TestFilePath = @"", - TestLineNumber = 41, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 6, true ); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), - TestFilePath = @"", - TestLineNumber = 41, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 5, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 6, true }, -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 7, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 8, true }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method4", - TestFilePath = @"", - TestLineNumber = 41, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 7, true); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), - TestFilePath = @"", - TestLineNumber = 41, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 5, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 6, true }, -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 7, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 8, true }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method4", - TestFilePath = @"", - TestLineNumber = 41, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.SomeMethod("Hello World!", 8, true ); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS3:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_Method4(methodArg)), - TestFilePath = @"", - TestLineNumber = 41, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 5, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 6, true }, -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = ["Hello World!", 7, true], -}, new global::TUnit.Core.MethodDataSourceAttribute("SomeMethod") -{ - Arguments = new global::System.Object[] { "Hello World!", 8, true }, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS3:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "DataSource_Method4", - TestFilePath = @"", - TestLineNumber = 41, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue methodArg = global::TUnit.TestProject.MethodDataSourceDrivenTests.MethodWithBaseReturn()(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_WithBaseReturn(methodArg)), - TestFilePath = @"", - TestLineNumber = 52, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("MethodWithBaseReturn") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]).ReturnType, - ParameterTypeFullNames = [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)], - TestName = "DataSource_WithBaseReturn", - TestFilePath = @"", - TestLineNumber = 52, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTestData()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTest(System.String[]):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.EnumerableFuncArrayTest(methodData)), - TestFilePath = @"", - TestLineNumber = 58, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncArrayTestData") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTest(System.String[]):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String[])], - TestName = "EnumerableFuncArrayTest", - TestFilePath = @"", - TestLineNumber = 58, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt index 63f5554153..9bf2932304 100644 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -76,7 +76,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method", TestFilePath = @"", @@ -119,7 +119,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method2", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -166,7 +166,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method2(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method2", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method2", TestFilePath = @"", @@ -209,7 +209,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method_WithAction", 0, [typeof(global::System.Action)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -256,7 +256,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method_WithAction(void System.Action()):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method_WithAction", 0, [typeof(global::System.Action)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method_WithAction", 0, [typeof(global::System.Action)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Action)], TestName = "DataSource_Method_WithAction", TestFilePath = @"", @@ -303,7 +303,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method3", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -353,7 +353,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method3", TestFilePath = @"", @@ -371,7 +371,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method3", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -421,7 +421,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method3(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method3", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method3", TestFilePath = @"", @@ -470,7 +470,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -526,7 +526,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method4", TestFilePath = @"", @@ -544,7 +544,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -600,7 +600,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method4", TestFilePath = @"", @@ -618,7 +618,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -674,7 +674,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS2:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method4", TestFilePath = @"", @@ -692,7 +692,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -748,7 +748,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS3:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_Method4(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_Method4", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "DataSource_Method4", TestFilePath = @"", @@ -791,7 +791,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -838,7 +838,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenTests.DataSource_WithBaseReturn(TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "DataSource_WithBaseReturn", 0, [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)]).ReturnType, ParameterTypeFullNames = [typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests.BaseValue)], TestName = "DataSource_WithBaseReturn", TestFilePath = @"", @@ -881,7 +881,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -932,7 +932,7 @@ file partial class MethodDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGen { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS0:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenTests.EnumerableFuncArrayTest(System.String[]):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests).GetMethod("EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenTests), "EnumerableFuncArrayTest", 0, [typeof(global::System.String[])]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String[])], TestName = "EnumerableFuncArrayTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 45e593d6c4..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,548 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MethodDataSourceDrivenWithCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.T(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.FuncT()(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.EnumerableT()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS2:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS2:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.EnumerableFuncT()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS3:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS3:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.ArrayT()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS4:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS4:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - foreach (var methodDataAccessor in global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.ArrayFuncT()) - { - testMethodDataIndex++; - - var methodData = methodDataAccessor(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS5:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [], - TestMethodArguments = [methodData], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MyTest(methodData, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 10, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("T") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("FuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("EnumerableFuncT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayT") -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("ArrayFuncT") -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func` rather than a ``") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS5:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MyTest", - TestFilePath = @"", - TestLineNumber = 10, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt index 7a3bf6c9d7..45e593d6c4 100644 --- a/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt @@ -37,7 +37,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -102,7 +102,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", @@ -120,7 +120,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -185,7 +185,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS1:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", @@ -203,7 +203,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -272,7 +272,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS2:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", @@ -290,7 +290,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -359,7 +359,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS3:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", @@ -377,7 +377,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -446,7 +446,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS4:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", @@ -464,7 +464,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core try { var testClassType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -533,7 +533,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : TUnit.Core { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-EMDS5:{testMethodDataIndex}:TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests.MyTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests).GetMethod("MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MethodDataSourceDrivenWithCancellationTokenTests), "MyTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MyTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 54d2cb3fcd..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,227 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MultipleClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1 classArg = classArgGeneratedData.Item1; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2 classArg1 = classArgGeneratedData.Item2; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3 classArg2 = classArgGeneratedData.Item3; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4 classArg3 = classArgGeneratedData.Item4; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5 classArg4 = classArgGeneratedData.Item5; - - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(classArg, classArg1, classArg2, classArg3, classArg4) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test1:0", - TestClassArguments = [classArg, classArg1, classArg2, classArg3, classArg4], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test1()), - TestFilePath = @"", - TestLineNumber = 14, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test1:0", - TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test1", - TestFilePath = @"", - TestLineNumber = 14, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new MultipleClassDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - var classArgDataGeneratorMetadata = new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Parameters, - TestClassType = testClassType, - ParameterInfos = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetConstructors().First().GetParameters(), - PropertyInfo = null, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}; - var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); - - var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); - - foreach (var classArgGeneratedDataAccessor in classArgGeneratedDataArray) - { - classDataIndex++; - var classArgGeneratedData = classArgGeneratedDataAccessor(); - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1 classArg = classArgGeneratedData.Item1; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2 classArg1 = classArgGeneratedData.Item2; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3 classArg2 = classArgGeneratedData.Item3; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4 classArg3 = classArgGeneratedData.Item4; - global::TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5 classArg4 = classArgGeneratedData.Item5; - - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.MultipleClassDataSourceDrivenTests(classArg, classArg1, classArg2, classArg3, classArg4) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test2:0", - TestClassArguments = [classArg, classArg1, classArg2, classArg3, classArg4], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2()), - TestFilePath = @"", - TestLineNumber = 20, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.ClassDataSourceAttribute() -{ - Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], -} ], - AssemblyAttributes = [ ], - DataAttributes = [ classDataAttribute ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test2:0", - TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test2", - TestFilePath = @"", - TestLineNumber = 20, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt index 9fccbd26a0..54d2cb3fcd 100644 --- a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So try { var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetMethod("Test1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -99,7 +99,7 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test1:0", TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetMethod("Test1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test1", TestFilePath = @"", @@ -142,7 +142,7 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So try { var testClassType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetMethod("Test2", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -212,7 +212,7 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So { TestId = $"global::TUnit.Core.ClassDataSourceAttribute:{classDataIndex}:CL-GAC0:TUnit.TestProject.MultipleClassDataSourceDrivenTests(TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject1,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject2,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject3,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject4,TUnit.TestProject.MultipleClassDataSourceDrivenTests.Inject5).Test2:0", TestClass = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetMethod("Test2", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests), "Test2", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test2", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 2e5ab4cbe7..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,92 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NameOfArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NameOfArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NameOfArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "TestName"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NameOfArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NameOfArgumentTests.TestName(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.TestName(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("TestName") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NameOfArgumentTests.TestName(System.String):0", - TestClass = typeof(global::TUnit.TestProject.NameOfArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "TestName", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt index f8e7b36f44..2e5ab4cbe7 100644 --- a/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class NameOfArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NameOfArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NameOfArgumentTests).GetMethod("TestName", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class NameOfArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NameOfArgumentTests.TestName(System.String):0", TestClass = typeof(global::TUnit.TestProject.NameOfArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NameOfArgumentTests).GetMethod("TestName", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NameOfArgumentTests), "TestName", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "TestName", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 0096a643de..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,337 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NullableByteArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Byte? methodArg = (global::System.Byte)1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NullableByteArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", - TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Byte?)], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Byte? methodArg = null; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NullableByteArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", - TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Byte?)], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NullableByteArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Byte methodArg = (global::System.Byte)1; - global::System.Byte? methodArg1 = (global::System.Byte)1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NullableByteArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 12, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", - TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], - TestName = "Test2", - TestFilePath = @"", - TestLineNumber = 12, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Byte methodArg = (global::System.Byte)1; - global::System.Byte? methodArg1 = null; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NullableByteArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test2(methodArg, methodArg1)), - TestFilePath = @"", - TestLineNumber = 12, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -}, new global::TUnit.Core.ArgumentsAttribute((global::System.Byte)1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", - TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], - TestName = "Test2", - TestFilePath = @"", - TestLineNumber = 12, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt index 16d5620d4e..0096a643de 100644 --- a/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NullableByteArgumentTests.Test.verified.txt @@ -33,7 +33,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener try { var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test", 0, [typeof(global::System.Byte?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -84,7 +84,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test", 0, [typeof(global::System.Byte?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Byte?)], TestName = "Test", TestFilePath = @"", @@ -102,7 +102,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener try { var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test", 0, [typeof(global::System.Byte?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -153,7 +153,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test(System.Byte?):0", TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test", 0, [typeof(global::System.Byte?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test", 0, [typeof(global::System.Byte?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Byte?)], TestName = "Test", TestFilePath = @"", @@ -200,7 +200,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener try { var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -252,7 +252,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], TestName = "Test2", TestFilePath = @"", @@ -270,7 +270,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener try { var testClassType = typeof(global::TUnit.TestProject.NullableByteArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -322,7 +322,7 @@ file partial class NullableByteArgumentTests : TUnit.Core.Interfaces.SourceGener { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.NullableByteArgumentTests.Test2(System.Byte,System.Byte?):0", TestClass = typeof(global::TUnit.TestProject.NullableByteArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NullableByteArgumentTests).GetMethod("Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NullableByteArgumentTests), "Test2", 0, [typeof(global::System.Byte), typeof(global::System.Byte?)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Byte), typeof(global::System.Byte?)], TestName = "Test2", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 8c4670a724..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,547 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "Int", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Double methodArg = 1.1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), - TestFilePath = @"", - TestLineNumber = 12, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Double)], - TestName = "Double", - TestFilePath = @"", - TestLineNumber = 12, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Single methodArg = 1.1f; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), - TestFilePath = @"", - TestLineNumber = 19, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.1f) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Single)], - TestName = "Float", - TestFilePath = @"", - TestLineNumber = 19, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int64 methodArg = 1L; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), - TestFilePath = @"", - TestLineNumber = 26, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1L) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int64)], - TestName = "Long", - TestFilePath = @"", - TestLineNumber = 26, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt64 methodArg = 1UL; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), - TestFilePath = @"", - TestLineNumber = 33, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1UL) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt64)], - TestName = "ULong", - TestFilePath = @"", - TestLineNumber = 33, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt32 methodArg = 1U; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), - TestFilePath = @"", - TestLineNumber = 40, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1U) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt32)], - TestName = "UInt", - TestFilePath = @"", - TestLineNumber = 40, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt index 2484cbff19..8c4670a724 100644 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Int", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Int", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "Int", TestFilePath = @"", @@ -120,7 +120,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Double", 0, [typeof(global::System.Double)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -168,7 +168,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Double", 0, [typeof(global::System.Double)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Double)], TestName = "Double", TestFilePath = @"", @@ -211,7 +211,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Float", 0, [typeof(global::System.Single)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -259,7 +259,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Float", 0, [typeof(global::System.Single)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Single)], TestName = "Float", TestFilePath = @"", @@ -302,7 +302,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Long", 0, [typeof(global::System.Int64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -350,7 +350,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Long", 0, [typeof(global::System.Int64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int64)], TestName = "Long", TestFilePath = @"", @@ -393,7 +393,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -441,7 +441,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt64)], TestName = "ULong", TestFilePath = @"", @@ -484,7 +484,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -532,7 +532,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt32)], TestName = "UInt", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt deleted file mode 100644 index 8c4670a724..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.DotNet9_0.received.txt +++ /dev/null @@ -1,547 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int32 methodArg = 1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Int(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32)], - TestName = "Int", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Double methodArg = 1.1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Double(methodArg)), - TestFilePath = @"", - TestLineNumber = 12, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.1) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Double)], - TestName = "Double", - TestFilePath = @"", - TestLineNumber = 12, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Single methodArg = 1.1f; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Float(methodArg)), - TestFilePath = @"", - TestLineNumber = 19, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1.1f) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Single)], - TestName = "Float", - TestFilePath = @"", - TestLineNumber = 19, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.Int64 methodArg = 1L; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Long(methodArg)), - TestFilePath = @"", - TestLineNumber = 26, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1L) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int64)], - TestName = "Long", - TestFilePath = @"", - TestLineNumber = 26, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt64 methodArg = 1UL; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.ULong(methodArg)), - TestFilePath = @"", - TestLineNumber = 33, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1UL) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt64)], - TestName = "ULong", - TestFilePath = @"", - TestLineNumber = 33, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new NumberArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.UInt32 methodArg = 1U; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.NumberArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.UInt(methodArg)), - TestFilePath = @"", - TestLineNumber = 40, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1U) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", - TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.UInt32)], - TestName = "UInt", - TestFilePath = @"", - TestLineNumber = 40, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt index 2484cbff19..8c4670a724 100644 --- a/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/NumberArgumentTests.TestDE.verified.txt @@ -29,7 +29,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Int", 0, [typeof(global::System.Int32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -77,7 +77,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Int(System.Int32):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Int", 0, [typeof(global::System.Int32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Int", 0, [typeof(global::System.Int32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32)], TestName = "Int", TestFilePath = @"", @@ -120,7 +120,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Double", 0, [typeof(global::System.Double)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -168,7 +168,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Double(System.Double):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Double", 0, [typeof(global::System.Double)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Double", 0, [typeof(global::System.Double)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Double)], TestName = "Double", TestFilePath = @"", @@ -211,7 +211,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Float", 0, [typeof(global::System.Single)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -259,7 +259,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Float(System.Single):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Float", 0, [typeof(global::System.Single)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Float", 0, [typeof(global::System.Single)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Single)], TestName = "Float", TestFilePath = @"", @@ -302,7 +302,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Long", 0, [typeof(global::System.Int64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -350,7 +350,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.Long(System.Int64):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("Long", 0, [typeof(global::System.Int64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "Long", 0, [typeof(global::System.Int64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int64)], TestName = "Long", TestFilePath = @"", @@ -393,7 +393,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -441,7 +441,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.ULong(System.UInt64):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("ULong", 0, [typeof(global::System.UInt64)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "ULong", 0, [typeof(global::System.UInt64)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt64)], TestName = "ULong", TestFilePath = @"", @@ -484,7 +484,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.NumberArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -532,7 +532,7 @@ file partial class NumberArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.NumberArgumentTests.UInt(System.UInt32):0", TestClass = typeof(global::TUnit.TestProject.NumberArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.NumberArgumentTests).GetMethod("UInt", 0, [typeof(global::System.UInt32)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.NumberArgumentTests), "UInt", 0, [typeof(global::System.UInt32)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.UInt32)], TestName = "UInt", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 030ebc25b9..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,535 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_1:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_1()), - TestFilePath = @"", - TestLineNumber = 12, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_1:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "High_1", - TestFilePath = @"", - TestLineNumber = 12, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_2:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_2()), - TestFilePath = @"", - TestLineNumber = 18, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_2:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "High_2", - TestFilePath = @"", - TestLineNumber = 18, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_3:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.High_3()), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.High) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.High_3:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "High_3", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_1:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Medium_1()), - TestFilePath = @"", - TestLineNumber = 30, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Medium) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_1:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Medium_1", - TestFilePath = @"", - TestLineNumber = 30, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_2:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Medium_2()), - TestFilePath = @"", - TestLineNumber = 36, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Medium) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_2:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Medium_2", - TestFilePath = @"", - TestLineNumber = 36, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PriorityFilteringTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PriorityFilteringTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Low_1:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Low_1()), - TestFilePath = @"", - TestLineNumber = 42, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.PriorityAttribute(global::TUnit.TestProject.Enums.PriorityLevel.Low) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PriorityFilteringTests.Low_1:0", - TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Low_1", - TestFilePath = @"", - TestLineNumber = 42, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt index 991b80ae32..030ebc25b9 100644 --- a/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/PriorityFilteringTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -75,7 +75,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.High_1:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "High_1", TestFilePath = @"", @@ -118,7 +118,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_2", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -164,7 +164,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.High_2:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_2", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_2", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "High_2", TestFilePath = @"", @@ -207,7 +207,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_3", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -253,7 +253,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.High_3:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("High_3", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "High_3", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "High_3", TestFilePath = @"", @@ -296,7 +296,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Medium_1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -342,7 +342,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_1:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Medium_1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Medium_1", TestFilePath = @"", @@ -385,7 +385,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Medium_2", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -431,7 +431,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.Medium_2:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Medium_2", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Medium_2", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Medium_2", TestFilePath = @"", @@ -474,7 +474,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato try { var testClassType = typeof(global::TUnit.TestProject.PriorityFilteringTests); - var methodInfo = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Low_1", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -520,7 +520,7 @@ file partial class PriorityFilteringTests : TUnit.Core.Interfaces.SourceGenerato { TestId = $"TUnit.TestProject.PriorityFilteringTests.Low_1:0", TestClass = typeof(global::TUnit.TestProject.PriorityFilteringTests), - ReturnType = typeof(global::TUnit.TestProject.PriorityFilteringTests).GetMethod("Low_1", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PriorityFilteringTests), "Low_1", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Low_1", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index aa5f3cb12f..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,162 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new PropertySetterTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.String propertyArg = "1"; - - global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); - var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); - var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo2, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); - var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo3, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); - var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo4, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); - var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo5, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); - var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata -{ - Type = TUnit.Core.Enums.DataGeneratorType.Property, - TestClassType = testClassType, - ParameterInfos = null, - PropertyInfo = propertyInfo6, - TestBuilderContext = testBuilderContextAccessor, - TestSessionId = sessionId, -}).ElementAtOrDefault(0)(); - - - global::TUnit.TestProject.PropertySetterTests.StaticProperty = propertyArg6; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.PropertySetterTests() - { - Property1 = propertyArg, - Property2 = propertyArg1, - Property3 = propertyArg2, - Property4 = propertyArg3, - Property5 = propertyArg4, - Property6 = propertyArg5, - } - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [propertyArg, propertyArg1, propertyArg2, propertyArg3, propertyArg4, propertyArg5], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), - TestFilePath = @"", - TestLineNumber = 70, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.NotInParallelAttribute("PropertySetterTests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ propertyDataAttribute2, propertyDataAttribute3, propertyDataAttribute4, propertyDataAttribute5, propertyDataAttribute6 ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", - TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Test", - TestFilePath = @"", - TestLineNumber = 70, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt index 46ba9ac154..aa5f3cb12f 100644 --- a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.PropertySetterTests); - var methodInfo = typeof(global::TUnit.TestProject.PropertySetterTests).GetMethod("Test", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -124,7 +124,7 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I ResettableClassFactory = resettableClassFactory, TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Test()), TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, TestAttributes = [ new global::TUnit.Core.TestAttribute() { @@ -147,11 +147,11 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"TUnit.TestProject.PropertySetterTests.Test:0", TestClass = typeof(global::TUnit.TestProject.PropertySetterTests), - ReturnType = typeof(global::TUnit.TestProject.PropertySetterTests).GetMethod("Test", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.PropertySetterTests), "Test", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Test", TestFilePath = @"", - TestLineNumber = 69, + TestLineNumber = 70, Exception = exception, }); } diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt deleted file mode 100644 index df6f45062f..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,682 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new RepeatTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.One:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 1, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.One()), - TestFilePath = @"", - TestLineNumber = 6, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.RepeatAttribute(1) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.One:0", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "One", - TestFilePath = @"", - TestLineNumber = 6, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.One:1", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 1, - RepeatLimit = 1, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.One()), - TestFilePath = @"", - TestLineNumber = 6, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.RepeatAttribute(1) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.One:1", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "One", - TestFilePath = @"", - TestLineNumber = 6, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new RepeatTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Two:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 2, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), - TestFilePath = @"", - TestLineNumber = 13, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.RepeatAttribute(2) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Two:0", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Two", - TestFilePath = @"", - TestLineNumber = 13, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Two:1", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 1, - RepeatLimit = 2, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), - TestFilePath = @"", - TestLineNumber = 13, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.RepeatAttribute(2) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Two:1", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Two", - TestFilePath = @"", - TestLineNumber = 13, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Two:2", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 2, - RepeatLimit = 2, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Two()), - TestFilePath = @"", - TestLineNumber = 13, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.RepeatAttribute(2) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Two:2", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Two", - TestFilePath = @"", - TestLineNumber = 13, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new RepeatTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Three:0", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 3, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), - TestFilePath = @"", - TestLineNumber = 20, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Three:0", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Three", - TestFilePath = @"", - TestLineNumber = 20, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Three:1", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 1, - RepeatLimit = 3, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), - TestFilePath = @"", - TestLineNumber = 20, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Three:1", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Three", - TestFilePath = @"", - TestLineNumber = 20, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Three:2", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 2, - RepeatLimit = 3, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), - TestFilePath = @"", - TestLineNumber = 20, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Three:2", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Three", - TestFilePath = @"", - TestLineNumber = 20, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.RepeatTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"TUnit.TestProject.RepeatTests.Three:3", - TestClassArguments = [], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 3, - RepeatLimit = 3, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Three()), - TestFilePath = @"", - TestLineNumber = 20, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.RepeatAttribute(3) -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"TUnit.TestProject.RepeatTests.Three:3", - TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, - ParameterTypeFullNames = [], - TestName = "Three", - TestFilePath = @"", - TestLineNumber = 20, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt index efdf228ea3..df6f45062f 100644 --- a/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/RepeatTests.Test.verified.txt @@ -33,7 +33,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("One", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -82,7 +82,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.One:0", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("One", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "One", TestFilePath = @"", @@ -100,7 +100,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("One", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -149,7 +149,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.One:1", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("One", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "One", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "One", TestFilePath = @"", @@ -197,7 +197,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -246,7 +246,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Two:0", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Two", TestFilePath = @"", @@ -264,7 +264,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -313,7 +313,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Two:1", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Two", TestFilePath = @"", @@ -331,7 +331,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -380,7 +380,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Two:2", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Two", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Two", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Two", TestFilePath = @"", @@ -429,7 +429,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -475,7 +475,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Three:0", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Three", TestFilePath = @"", @@ -493,7 +493,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -539,7 +539,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Three:1", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Three", TestFilePath = @"", @@ -557,7 +557,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -603,7 +603,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Three:2", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Three", TestFilePath = @"", @@ -621,7 +621,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour try { var testClassType = typeof(global::TUnit.TestProject.RepeatTests); - var methodInfo = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -667,7 +667,7 @@ file partial class RepeatTests : TUnit.Core.Interfaces.SourceGenerator.ITestSour { TestId = $"TUnit.TestProject.RepeatTests.Three:3", TestClass = typeof(global::TUnit.TestProject.RepeatTests), - ReturnType = typeof(global::TUnit.TestProject.RepeatTests).GetMethod("Three", 0, []).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.RepeatTests), "Three", 0, []).ReturnType, ParameterTypeFullNames = [], TestName = "Three", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 81ca525f1a..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,135 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_STAThreadTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "BeforeTest", 0, []), - Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), - HookExecutor = new global::TUnit.Core.STAThreadExecutor(), - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) -{ - -}, new global::TUnit.Core.Executors.HookExecutorAttribute() -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") -{ - -} ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_STAThreadTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "AfterTest", 0, []), - Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), - HookExecutor = new global::TUnit.Core.STAThreadExecutor(), - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) -{ - -}, new global::TUnit.Core.Executors.HookExecutorAttribute() -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") -{ - -} ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt index b954ee6f12..81ca525f1a 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt @@ -38,10 +38,22 @@ file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator. [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.STAThreadTests).GetMethod("BeforeTest", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "BeforeTest", 0, []), Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), HookExecutor = new global::TUnit.Core.STAThreadExecutor(), Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], }, ]; } @@ -99,10 +111,22 @@ file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator. [ new InstanceHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.STAThreadTests).GetMethod("AfterTest", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "AfterTest", 0, []), Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), HookExecutor = new global::TUnit.Core.STAThreadExecutor(), Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt deleted file mode 100644 index cbfd420a13..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,1490 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new StringArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ..Tests6(sessionId), - ..Tests7(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = ""; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = @"\"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = @"\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests6(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests7(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = """ - Hello - World - """; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Normal(methodArg)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(""" - Hello - World - """) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Normal", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new StringArgumentTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ..Tests3(sessionId), - ..Tests4(sessionId), - ..Tests5(sessionId), - ..Tests6(sessionId), - ..Tests7(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = ""; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = @"\"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = @"\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests3(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests4(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests5(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests6(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = "\\\\t"; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests7(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - global::System.String methodArg = null; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.StringArgumentTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClassArguments = [], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.Nullable(methodArg)), - TestFilePath = @"", - TestLineNumber = 24, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute("") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(@"\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute("\\\\t") -{ - -}, new global::TUnit.Core.ArgumentsAttribute(null) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", - TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.String)], - TestName = "Nullable", - TestFilePath = @"", - TestLineNumber = 24, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt index 82487ae4d1..cbfd420a13 100644 --- a/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/StringArgumentTests.Test.verified.txt @@ -39,7 +39,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -111,7 +111,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -129,7 +129,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -201,7 +201,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -219,7 +219,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -291,7 +291,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -309,7 +309,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -381,7 +381,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -399,7 +399,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -471,7 +471,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -489,7 +489,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -561,7 +561,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -579,7 +579,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -651,7 +651,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -669,7 +669,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -744,7 +744,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Normal(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Normal", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Normal", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Normal", TestFilePath = @"", @@ -797,7 +797,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -866,7 +866,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -884,7 +884,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -953,7 +953,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS1:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -971,7 +971,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1040,7 +1040,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS2:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -1058,7 +1058,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1127,7 +1127,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS3:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -1145,7 +1145,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1214,7 +1214,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS4:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -1232,7 +1232,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1301,7 +1301,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS5:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -1319,7 +1319,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1388,7 +1388,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS6:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", @@ -1406,7 +1406,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I try { var testClassType = typeof(global::TUnit.TestProject.StringArgumentTests); - var methodInfo = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -1475,7 +1475,7 @@ file partial class StringArgumentTests : TUnit.Core.Interfaces.SourceGenerator.I { TestId = $"global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS7:TUnit.TestProject.StringArgumentTests.Nullable(System.String):0", TestClass = typeof(global::TUnit.TestProject.StringArgumentTests), - ReturnType = typeof(global::TUnit.TestProject.StringArgumentTests).GetMethod("Nullable", 0, [typeof(global::System.String)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.StringArgumentTests), "Nullable", 0, [typeof(global::System.String)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.String)], TestName = "Nullable", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 401c854288..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,103 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_TestDiscoveryHookTests(); - SourceRegistrar.RegisterTestDiscoveryHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) - { - return - [ - new global::TUnit.Core.Hooks.BeforeTestDiscoveryHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "BeforeDiscovery", 0, []), - Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.BeforeDiscovery(), - HookExecutor = DefaultExecutor.Instance, - Order = 5, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(4) -{ - Order = 5, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_TestDiscoveryHookTests(); - SourceRegistrar.RegisterTestDiscoveryHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) - { - return - [ - new global::TUnit.Core.Hooks.AfterTestDiscoveryHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "AfterDiscovery", 0, []), - Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.AfterDiscovery(), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 10, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(4) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt index 17e4f712fd..401c854288 100644 --- a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt @@ -26,12 +26,18 @@ file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGe [ new global::TUnit.Core.Hooks.BeforeTestDiscoveryHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.TestDiscoveryHookTests).GetMethod("BeforeDiscovery", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "BeforeDiscovery", 0, []), Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.BeforeDiscovery(), HookExecutor = DefaultExecutor.Instance, Order = 5, FilePath = @"", LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(4) +{ + Order = 5, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } @@ -77,12 +83,18 @@ file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGe [ new global::TUnit.Core.Hooks.AfterTestDiscoveryHookMethod { - MethodInfo = typeof(global::TUnit.TestProject.TestDiscoveryHookTests).GetMethod("AfterDiscovery", 0, []), + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "AfterDiscovery", 0, []), Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.AfterDiscovery(), HookExecutor = DefaultExecutor.Instance, Order = 0, FilePath = @"", LineNumber = 10, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(4) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], }, ]; } diff --git a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 364f9ed2d4..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,748 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DefaultTest(System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DefaultTest(cancellationToken)), - TestFilePath = @"", - TestLineNumber = 15, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DefaultTest(System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], - TestName = "DefaultTest", - TestFilePath = @"", - TestLineNumber = 15, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).BasicTest(System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.BasicTest(cancellationToken)), - TestFilePath = @"", - TestLineNumber = 21, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -}, new global::TUnit.Core.CategoryAttribute("Blah") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).BasicTest(System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], - TestName = "BasicTest", - TestFilePath = @"", - TestLineNumber = 21, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).InheritedTimeoutAttribute(System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.InheritedTimeoutAttribute(cancellationToken)), - TestFilePath = @"", - TestLineNumber = 29, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.TestProject.TimeoutCancellationTokenTests.FiveSecondTimeout() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).InheritedTimeoutAttribute(System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], - TestName = "InheritedTimeoutAttribute", - TestFilePath = @"", - TestLineNumber = 29, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - global::System.Int32 methodArg = 1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 36, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.ArgumentsAttribute(1) -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "DataTest", - TestFilePath = @"", - TestLineNumber = 36, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - global::System.Int32 methodArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataSourceTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSourceTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 47, - TestAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -}, new global::TUnit.Core.TestAttribute() -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataSourceTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "DataSourceTest", - TestFilePath = @"", - TestLineNumber = 47, - Exception = exception, - }); - } - return nodes; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TimeoutCancellationTokenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return - [ - ..Tests0(sessionId), - ..Tests1(sessionId), - ..Tests2(sessionId), - ]; - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - global::System.Int32 methodArg = 1; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 54, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -}, new global::TUnit.Core.CategoryAttribute("Blah") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MatrixTest", - TestFilePath = @"", - TestLineNumber = 54, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests1(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - global::System.Int32 methodArg = 2; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS1:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 54, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -}, new global::TUnit.Core.CategoryAttribute("Blah") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS1:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MatrixTest", - TestFilePath = @"", - TestLineNumber = 54, - Exception = exception, - }); - } - return nodes; - } - private global::System.Collections.Generic.List Tests2(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - global::System.Int32 classArg = global::TUnit.TestProject.TimeoutCancellationTokenTests.DataSource(); - - global::System.Int32 methodArg = 3; - - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TimeoutCancellationTokenTests(classArg) - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS2:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClassArguments = [classArg], - TestMethodArguments = [methodArg], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.MatrixTest(methodArg, cancellationToken)), - TestFilePath = @"", - TestLineNumber = 54, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.TimeoutAttribute(5_000) -{ - -}, new global::TUnit.Core.CategoryAttribute("Blah") -{ - -} ], - ClassAttributes = [ new global::TUnit.Core.MethodDataSourceAttribute("DataSource") -{ - -}, new global::TUnit.Core.CategoryAttribute("Timeout Cancellation Token Tests") -{ - -} ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS2:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", - TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], - TestName = "MatrixTest", - TestFilePath = @"", - TestLineNumber = 54, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt index 43fbfe5ea3..364f9ed2d4 100644 --- a/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TimeoutCancellationTokenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -79,7 +79,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DefaultTest(System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DefaultTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], TestName = "DefaultTest", TestFilePath = @"", @@ -122,7 +122,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -178,7 +178,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).BasicTest(System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "BasicTest", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], TestName = "BasicTest", TestFilePath = @"", @@ -221,7 +221,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -274,7 +274,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).InheritedTimeoutAttribute(System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "InheritedTimeoutAttribute", 0, [typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Threading.CancellationToken)], TestName = "InheritedTimeoutAttribute", TestFilePath = @"", @@ -317,7 +317,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -375,7 +375,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.ArgumentsAttribute:{testMethodDataIndex}:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "DataTest", TestFilePath = @"", @@ -418,7 +418,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -475,7 +475,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).DataSourceTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "DataSourceTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "DataSourceTest", TestFilePath = @"", @@ -523,7 +523,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -581,7 +581,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS0:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MatrixTest", TestFilePath = @"", @@ -599,7 +599,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -657,7 +657,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS1:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MatrixTest", TestFilePath = @"", @@ -675,7 +675,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG try { var testClassType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests); - var methodInfo = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -733,7 +733,7 @@ file partial class TimeoutCancellationTokenTests : TUnit.Core.Interfaces.SourceG { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{classDataIndex}:CL-MDS0:TL-ARGS2:TUnit.TestProject.TimeoutCancellationTokenTests(System.Int32).MatrixTest(System.Int32,System.Threading.CancellationToken):0", TestClass = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), - ReturnType = typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests).GetMethod("MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TimeoutCancellationTokenTests), "MatrixTest", 0, [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.Threading.CancellationToken)], TestName = "MatrixTest", TestFilePath = @"", diff --git a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 41b292a102..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,94 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::TUnit.Core; -using global::TUnit.Core.Extensions; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class TupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGenerator.ITestSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - SourceRegistrar.Register(new TupleDataSourceDrivenTests()); - } - public global::System.Collections.Generic.IReadOnlyList CollectTests(string sessionId) - { - return Tests0(sessionId); - } - private global::System.Collections.Generic.List Tests0(string sessionId) - { - global::System.Collections.Generic.List nodes = []; - var classDataIndex = 0; - var testMethodDataIndex = 0; - try - { - var testClassType = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests); - var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); - - var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); - var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); - - var methodArgTuples = global::System.TupleExtensions.ToTuple(global::TUnit.TestProject.TupleDataSourceDrivenTests.TupleMethod()); - global::System.Int32 methodArg = methodArgTuples.Item1; - global::System.String methodArg1 = methodArgTuples.Item2; - global::System.Boolean methodArg2 = methodArgTuples.Item3; - var resettableClassFactoryDelegate = () => new ResettableLazy(() => - new global::TUnit.TestProject.TupleDataSourceDrivenTests() - , sessionId, testBuilderContext); - - var resettableClassFactory = resettableClassFactoryDelegate(); - - nodes.Add(new TestMetadata - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClassArguments = [], - TestMethodArguments = [methodArg, methodArg1, methodArg2], - TestClassProperties = [], - CurrentRepeatAttempt = 0, - RepeatLimit = 0, - MethodInfo = methodInfo, - ResettableClassFactory = resettableClassFactory, - TestMethodFactory = (classInstance, cancellationToken) => AsyncConvert.Convert(() => classInstance.DataSource_TupleMethod(methodArg, methodArg1, methodArg2)), - TestFilePath = @"", - TestLineNumber = 5, - TestAttributes = [ new global::TUnit.Core.TestAttribute() -{ - -}, new global::TUnit.Core.MethodDataSourceAttribute("TupleMethod") -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - DataAttributes = [ ], - TestBuilderContext = testBuilderContext, - }); - resettableClassFactory = resettableClassFactoryDelegate(); - testBuilderContext = new(); - testBuilderContextAccessor.Current = testBuilderContext; - } - catch (global::System.Exception exception) - { - nodes.Add(new FailedInitializationTest - { - TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", - TestClass = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), - ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, - ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], - TestName = "DataSource_TupleMethod", - TestFilePath = @"", - TestLineNumber = 5, - Exception = exception, - }); - } - return nodes; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt index 716e310d7d..41b292a102 100644 --- a/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TupleDataSourceDrivenTests.Test.verified.txt @@ -29,7 +29,7 @@ file partial class TupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene try { var testClassType = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests); - var methodInfo = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); + var methodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]); var testBuilderContext = new global::TUnit.Core.TestBuilderContext(); var testBuilderContextAccessor = new global::TUnit.Core.TestBuilderContextAccessor(testBuilderContext); @@ -79,7 +79,7 @@ file partial class TupleDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene { TestId = $"global::TUnit.Core.MethodDataSourceAttribute:{testMethodDataIndex}:TL-MDS0:TUnit.TestProject.TupleDataSourceDrivenTests.DataSource_TupleMethod(System.Int32,System.String,System.Boolean):0", TestClass = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), - ReturnType = typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests).GetMethod("DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, + ReturnType = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TupleDataSourceDrivenTests), "DataSource_TupleMethod", 0, [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)]).ReturnType, ParameterTypeFullNames = [typeof(global::System.Int32), typeof(global::System.String), typeof(global::System.Boolean)], TestName = "DataSource_TupleMethod", TestFilePath = @"", From 68c579c2b4ed46a96a8a69b85367f0cfa4675b60 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:51:35 +0000 Subject: [PATCH 50/71] Enum fix --- .../Helpers/FullyQualifiedWithGlobalPrefixRewriter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/FullyQualifiedWithGlobalPrefixRewriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/FullyQualifiedWithGlobalPrefixRewriter.cs index 49ad069eb1..5da6028f0e 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/FullyQualifiedWithGlobalPrefixRewriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/FullyQualifiedWithGlobalPrefixRewriter.cs @@ -29,7 +29,14 @@ public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) { var symbol = node.GetSymbolInfo(semanticModel); - if (symbol.IsConst(out var constantValue)) + if (symbol is not IFieldSymbol + { + Type: INamedTypeSymbol + { + TypeKind: TypeKind.Enum + } + } + && symbol.IsConst(out var constantValue)) { return Literal(constantValue); } From 9168b3186a8f2cf76dea7a0bfa7fb1878c3a712c Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:56:20 +0000 Subject: [PATCH 51/71] Enum fix --- .../AfterAllTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ .../AfterTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...mblyAfterTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...blyBeforeTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...BeforeAllTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ .../BeforeTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...AfterEachTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...eforeEachTests.Test.DotNet9_0.received.txt | 875 ++++++++++++++++++ ...readHooksTests.Test.DotNet9_0.received.txt | 135 +++ ...overyHookTests.Test.DotNet9_0.received.txt | 103 +++ 10 files changed, 7238 insertions(+) create mode 100644 TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt create mode 100644 TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..178aec229b --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..178aec229b --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) + { + return + [ + new AfterClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_CleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..9999dfbc6d --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) + { + return + [ + new AfterAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyCleanupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..3110c85b91 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblyBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterAssemblyHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) + { + return + [ + new BeforeAssemblyHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_AssemblySetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..36dcca6013 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..36dcca6013 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_Base3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterClassHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) + { + return + [ + new BeforeClassHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_SetupTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..4bf81bbb42 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase1.AfterAll1(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase2.AfterAll2(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase3.AfterAll3(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalCleanUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + new AfterTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..f1877c4606 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt @@ -0,0 +1,875 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeEach1", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeEach2", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeEach3", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, []), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.TimeoutAttribute(30_000) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase1(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase1.BeforeAll1(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase2(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase2.BeforeAll2(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 20, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalBase3(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase3.BeforeAll3(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 35, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 50, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 56, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 62, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_GlobalSetUpTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + new BeforeTestHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), + AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context, cancellationToken)), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 68, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; +} +public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) +{ + return + [ + ]; +} +public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) +{ + return + [ + ]; +} +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..b4da388f60 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt @@ -0,0 +1,135 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_STAThreadTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "BeforeTest", 0, []), + Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), + HookExecutor = new global::TUnit.Core.STAThreadExecutor(), + Order = 0, + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_STAThreadTests(); + SourceRegistrar.RegisterTestHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) + { + return + [ + new InstanceHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "AfterTest", 0, []), + Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), + HookExecutor = new global::TUnit.Core.STAThreadExecutor(), + Order = 0, + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) +{ + +}, new global::TUnit.Core.Executors.HookExecutorAttribute() +{ + +} ], + ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") +{ + +} ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt new file mode 100644 index 0000000000..41e945b477 --- /dev/null +++ b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt @@ -0,0 +1,103 @@ +[ +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_TestDiscoveryHookTests(); + SourceRegistrar.RegisterTestDiscoveryHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) + { + return + [ + new global::TUnit.Core.Hooks.BeforeTestDiscoveryHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "BeforeDiscovery", 0, []), + Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.BeforeDiscovery(), + HookExecutor = DefaultExecutor.Instance, + Order = 5, + FilePath = @"", + LineNumber = 5, + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) +{ + Order = 5, +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) + { + return + [ + ]; + } +} + + +// +#pragma warning disable +using global::System.Linq; +using global::System.Reflection; +using global::System.Runtime.CompilerServices; +using global::TUnit.Core; +using global::TUnit.Core.Hooks; +using global::TUnit.Core.Interfaces; + +namespace TUnit.SourceGenerated; + +[global::System.Diagnostics.StackTraceHidden] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource +{ + [global::System.Runtime.CompilerServices.ModuleInitializer] + public static void Initialise() + { + var instance = new Hooks_TestDiscoveryHookTests(); + SourceRegistrar.RegisterTestDiscoveryHookSource(instance); + } + public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) + { + return + [ + ]; + } + public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) + { + return + [ + new global::TUnit.Core.Hooks.AfterTestDiscoveryHookMethod + { + MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "AfterDiscovery", 0, []), + Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.AfterDiscovery(), + HookExecutor = DefaultExecutor.Instance, + Order = 0, + FilePath = @"", + LineNumber = 10, + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) +{ + +} ], + ClassAttributes = [ ], + AssemblyAttributes = [ ], + }, + ]; + } +} + +] \ No newline at end of file From fb0403864e5290356a6560d055616b5617ac4ed6 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:11:38 +0000 Subject: [PATCH 52/71] Remove dupe package versions --- Directory.Packages.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 096799f541..766fe273ab 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -59,9 +59,7 @@ - - From 212f9735013bc3a36b61fea685597f0bf162da9f Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:14:27 +0000 Subject: [PATCH 53/71] Remove dupe package versions --- Directory.Packages.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 766fe273ab..5773a577a3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -59,8 +59,6 @@ - - From 680d964770c020d428451fd5cc40bf29386dc833 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:37:15 +0000 Subject: [PATCH 54/71] Remove calls to GetCustomAttributes --- .../CodeGenerators/Helpers/ArgumentsRetriever.cs | 2 +- .../Helpers/DataSourceGeneratorRetriever.cs | 9 +++++---- .../Arguments/GeneratedArgumentsContainer.cs | 14 ++++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/ArgumentsRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/ArgumentsRetriever.cs index 38cc975ef1..13adca5bf4 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/ArgumentsRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/ArgumentsRetriever.cs @@ -63,7 +63,7 @@ public static IEnumerable GetArguments(GeneratorAttributeSyntaxCo if (dataAttribute.AttributeClass?.IsOrInherits(WellKnownFullyQualifiedClassNames .DataSourceGeneratorAttribute.WithGlobalPrefix) == true) { - yield return DataSourceGeneratorRetriever.Parse(namedTypeSymbol, dataAttribute, argumentsType, + yield return DataSourceGeneratorRetriever.Parse(context, namedTypeSymbol, dataAttribute, argumentsType, index, propertyName); } } diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/DataSourceGeneratorRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/DataSourceGeneratorRetriever.cs index 9d92977178..1f5b9a69d6 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/DataSourceGeneratorRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/DataSourceGeneratorRetriever.cs @@ -7,15 +7,16 @@ namespace TUnit.Core.SourceGenerator.CodeGenerators.Helpers; public static class DataSourceGeneratorRetriever { - public static ArgumentsContainer Parse( - INamedTypeSymbol namedTypeSymbol, - AttributeData attributeData, - ArgumentsType argumentsType, + public static ArgumentsContainer Parse(GeneratorAttributeSyntaxContext context, INamedTypeSymbol namedTypeSymbol, + AttributeData attributeData, + ArgumentsType argumentsType, int index, string? propertyName) { return new GeneratedArgumentsContainer ( + context, + attributeData: attributeData, ArgumentsType: argumentsType, TestClassTypeName: namedTypeSymbol.ToDisplayString(DisplayFormats.FullyQualifiedGenericWithGlobalPrefix), AttributeDataGeneratorType: attributeData.AttributeClass!.ToDisplayString(DisplayFormats diff --git a/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs b/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs index 52bd5e9a7e..4ced356cb1 100644 --- a/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs +++ b/TUnit.Core.SourceGenerator/Models/Arguments/GeneratedArgumentsContainer.cs @@ -1,3 +1,4 @@ +using Microsoft.CodeAnalysis; using TUnit.Core.SourceGenerator.CodeGenerators.Writers; using TUnit.Core.SourceGenerator.Enums; @@ -5,9 +6,13 @@ namespace TUnit.Core.SourceGenerator.Models.Arguments; public record GeneratedArgumentsContainer : ArgumentsContainer { - public GeneratedArgumentsContainer(ArgumentsType ArgumentsType, int AttributeIndex, string TestClassTypeName, string[] GenericArguments, string AttributeDataGeneratorType) : base(ArgumentsType) + public GeneratedArgumentsContainer(GeneratorAttributeSyntaxContext context, AttributeData attributeData, + ArgumentsType ArgumentsType, int AttributeIndex, string TestClassTypeName, string[] GenericArguments, + string AttributeDataGeneratorType) : base(ArgumentsType) { this.AttributeIndex = AttributeIndex; + Context = context; + AttributeData = attributeData; this.TestClassTypeName = TestClassTypeName; this.GenericArguments = GenericArguments; this.AttributeDataGeneratorType = AttributeDataGeneratorType; @@ -57,8 +62,7 @@ public override void OpenScope(SourceCodeWriter sourceCodeWriter, ref int variab var arrayVariableName = $"{VariableNamePrefix}GeneratedDataArray"; var generatedDataVariableName = $"{VariableNamePrefix}GeneratedData"; - var dataAttr = GenerateDataAttributeVariable("var", - $"{objectToGetAttributesFrom}.GetCustomAttributes<{AttributeDataGeneratorType}>(true).ElementAt({AttributeIndex})", + var dataAttr = GenerateDataAttributeVariable("var", AttributeWriter.WriteAttribute(Context, AttributeData), ref variableIndex); sourceCodeWriter.WriteLine(dataAttr.ToString()); @@ -110,7 +114,7 @@ public override void WriteVariableAssignments(SourceCodeWriter sourceCodeWriter, if (ArgumentsType == ArgumentsType.Property) { var attr = GenerateDataAttributeVariable("var", - $"{objectToGetAttributesFrom}.GetCustomAttributes<{AttributeDataGeneratorType}>(true).ElementAt(0)", + AttributeWriter.WriteAttribute(Context, AttributeData), ref variableIndex); sourceCodeWriter.WriteLine(attr.ToString()); @@ -170,6 +174,8 @@ public override string[] GetArgumentTypes() return GenericArguments; } + public GeneratorAttributeSyntaxContext Context { get; } + public AttributeData AttributeData { get; } public string TestClassTypeName { get; } public string[] GenericArguments { get; } From e5f673a258f289c3603188e08401251104d4f5e7 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:44:57 +0000 Subject: [PATCH 55/71] Fix verify tests --- .../AfterAllTests.Test.DotNet9_0.received.txt | 875 ------------------ .../AfterAllTests.Test.verified.txt | 28 +- .../AfterTests.Test.DotNet9_0.received.txt | 875 ------------------ .../AfterTests.Test.verified.txt | 28 +- ...mblyAfterTests.Test.DotNet9_0.received.txt | 875 ------------------ .../AssemblyAfterTests.Test.verified.txt | 28 +- ...blyBeforeTests.Test.DotNet9_0.received.txt | 875 ------------------ .../AssemblyBeforeTests.Test.verified.txt | 28 +- ...BeforeAllTests.Test.DotNet9_0.received.txt | 875 ------------------ .../BeforeAllTests.Test.verified.txt | 28 +- .../BeforeTests.Test.DotNet9_0.received.txt | 875 ------------------ .../BeforeTests.Test.verified.txt | 28 +- ...assDataSourceDrivenTests.Test.verified.txt | 35 +- ...ssDataSourceDrivenTests2.Test.verified.txt | 20 +- ...ceDrivenTestsSharedKeyed.Test.verified.txt | 10 +- ...DataSourceGeneratorTests.Test.verified.txt | 60 +- ...AfterEachTests.Test.DotNet9_0.received.txt | 875 ------------------ ...obalStaticAfterEachTests.Test.verified.txt | 28 +- ...eforeEachTests.Test.DotNet9_0.received.txt | 875 ------------------ ...balStaticBeforeEachTests.Test.verified.txt | 28 +- ...ritedPropertySetterTests.Test.verified.txt | 50 +- ...assDataSourceDrivenTests.Test.verified.txt | 10 +- .../PropertySetterTests.Test.verified.txt | 25 +- ...readHooksTests.Test.DotNet9_0.received.txt | 135 --- .../STAThreadHooksTests.Test.verified.txt | 4 +- ...overyHookTests.Test.DotNet9_0.received.txt | 103 --- .../TestDiscoveryHookTests.Test.verified.txt | 4 +- 27 files changed, 284 insertions(+), 7396 deletions(-) delete mode 100644 TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt delete mode 100644 TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 178aec229b..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt index 1d055a9dd1..178aec229b 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt @@ -50,7 +50,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -111,7 +111,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -174,7 +174,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -235,7 +235,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -298,7 +298,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -359,7 +359,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -422,7 +422,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -485,7 +485,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -548,7 +548,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -611,7 +611,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -672,7 +672,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -733,7 +733,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -797,7 +797,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -858,7 +858,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 178aec229b..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.Base3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.Base3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) - { - return - [ - new AfterClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.CleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_CleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.CleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt index 1d055a9dd1..178aec229b 100644 --- a/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt @@ -50,7 +50,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -111,7 +111,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -174,7 +174,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -235,7 +235,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -298,7 +298,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -359,7 +359,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -422,7 +422,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -485,7 +485,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -548,7 +548,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -611,7 +611,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IC Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(1) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -672,7 +672,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -733,7 +733,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -797,7 +797,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -858,7 +858,7 @@ file partial class Hooks_CleanupTests : TUnit.Core.Interfaces.SourceGenerator.IT AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 9999dfbc6d..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase1.AfterAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase2.AfterAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyBase3.AfterAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyBase3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) - { - return - [ - new AfterAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.AssemblyCleanupTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "Cleanup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyCleanupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.AssemblyCleanupTests), "CleanupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt index 8f845aebe8..9999dfbc6d 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyAfterTests.Test.verified.txt @@ -50,7 +50,7 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -111,7 +111,7 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -174,7 +174,7 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -235,7 +235,7 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -298,7 +298,7 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -359,7 +359,7 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -422,7 +422,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -485,7 +485,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -548,7 +548,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -611,7 +611,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(2) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -672,7 +672,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -733,7 +733,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Cleanup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -797,7 +797,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -858,7 +858,7 @@ file partial class Hooks_AssemblyCleanupTests : TUnit.Core.Interfaces.SourceGene AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 3110c85b91..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblyBase3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblyBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblyBase3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.IAssemblyHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterAssemblyHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryAssemblyHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeAssemblyHooks(string sessionId) - { - return - [ - new BeforeAssemblyHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.AssemblyHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.AssemblySetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterAssemblyHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_AssemblySetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.AssemblySetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt index 4078cfd9c5..3110c85b91 100644 --- a/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/AssemblyBeforeTests.Test.verified.txt @@ -44,7 +44,7 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -105,7 +105,7 @@ file partial class Hooks_AssemblyBase1 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -168,7 +168,7 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -229,7 +229,7 @@ file partial class Hooks_AssemblyBase2 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -292,7 +292,7 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -353,7 +353,7 @@ file partial class Hooks_AssemblyBase3 : TUnit.Core.Interfaces.SourceGenerator.I AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -416,7 +416,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -479,7 +479,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -542,7 +542,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -605,7 +605,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(2) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Assembly) { } ], @@ -666,7 +666,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -727,7 +727,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -791,7 +791,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -852,7 +852,7 @@ file partial class Hooks_AssemblySetupTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 36dcca6013..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt index ec356791e0..36dcca6013 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeAllTests.Test.verified.txt @@ -44,7 +44,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -105,7 +105,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -168,7 +168,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -229,7 +229,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -292,7 +292,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -353,7 +353,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -416,7 +416,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -479,7 +479,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -542,7 +542,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -605,7 +605,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -666,7 +666,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -727,7 +727,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -791,7 +791,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -852,7 +852,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 36dcca6013..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeAll1", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base1.BeforeAll1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeAll2", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base2.BeforeAll2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeAll3", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.Base3.BeforeAll3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_Base3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.Base3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, []), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.IClassHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterClassHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryClassHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeClassHooks(string sessionId) - { - return - [ - new BeforeClassHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.ClassHookContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.SetupTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterClassHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "Setup", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_SetupTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.SetupTests), "SetupWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt index ec356791e0..36dcca6013 100644 --- a/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/BeforeTests.Test.verified.txt @@ -44,7 +44,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -105,7 +105,7 @@ file partial class Hooks_Base1 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -168,7 +168,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -229,7 +229,7 @@ file partial class Hooks_Base2 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -292,7 +292,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.IClassHoo Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -353,7 +353,7 @@ file partial class Hooks_Base3 : TUnit.Core.Interfaces.SourceGenerator.ITestHook AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -416,7 +416,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -479,7 +479,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -542,7 +542,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -605,7 +605,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ICla Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(1) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Class) { } ], @@ -666,7 +666,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -727,7 +727,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.Setup(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -791,7 +791,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -852,7 +852,7 @@ file partial class Hooks_SetupTests : TUnit.Core.Interfaces.SourceGenerator.ITes AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetupWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt index f263d21a73..736defd85d 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests.Test.verified.txt @@ -42,7 +42,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -149,7 +152,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -256,7 +262,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -363,7 +372,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -473,7 +485,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -584,7 +599,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -696,7 +714,10 @@ file partial class ClassDataSourceDrivenTests : TUnit.Core.Interfaces.SourceGene TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt index 2cd2dd3ed2..d5a78e14d6 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTests2.Test.verified.txt @@ -46,7 +46,10 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -131,7 +134,10 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -245,7 +251,10 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -330,7 +339,10 @@ file partial class ClassDataSourceDrivenTests2 : TUnit.Core.Interfaces.SourceGen TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.ClassDataSourceDrivenTests2).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); diff --git a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt index 533d8fd388..9359d9de16 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt @@ -42,7 +42,10 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -149,7 +152,10 @@ file partial class ClassDataSourceDrivenTestsSharedKeyed : TUnit.Core.Interfaces TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "🔑", +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); diff --git a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt index b7757993b7..db21df673d 100644 --- a/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/DataSourceGeneratorTests.Test.verified.txt @@ -46,7 +46,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -62,7 +65,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -156,7 +162,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -172,7 +181,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -295,7 +307,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -311,7 +326,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -409,7 +427,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -425,7 +446,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes>(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -552,7 +576,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -568,7 +595,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); @@ -666,7 +696,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.DataSourceGeneratorTests).GetCustomAttributes(true).ElementAt(0); + var classDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -682,7 +715,10 @@ file partial class DataSourceGeneratorTests : TUnit.Core.Interfaces.SourceGenera TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var methodDataAttribute = methodInfo.GetCustomAttributes(true).ElementAt(0); + var methodDataAttribute = new global::TUnit.TestProject.DataSourceGeneratorTests.AutoFixtureGeneratorAttribute() +{ + +}; var methodArgGeneratedDataArray = methodDataAttribute.GenerateDataSources(methodArgDataGeneratorMetadata); diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 4bf81bbb42..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "CleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase1), "AfterAll1", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase1.AfterAll1(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase2), "AfterAll2", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase2.AfterAll2(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalBase3), "AfterAll3", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalBase3.AfterAll3(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUp(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalCleanUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - new AfterTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.AfterTests.GlobalCleanUpTests), "AfterAllCleanUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.AfterTests.GlobalCleanUpTests.AfterAllCleanUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt index e8eb65cd48..4bf81bbb42 100644 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticAfterEachTests.Test.verified.txt @@ -48,7 +48,7 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -109,7 +109,7 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -170,7 +170,7 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.AfterEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -231,7 +231,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -292,7 +292,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -356,7 +356,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -417,7 +417,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.CleanUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -471,7 +471,7 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -534,7 +534,7 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -597,7 +597,7 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -660,7 +660,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -723,7 +723,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -786,7 +786,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -849,7 +849,7 @@ file partial class Hooks_GlobalCleanUpTests : TUnit.Core.Interfaces.SourceGenera Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.Test) { } ], diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt deleted file mode 100644 index f1877c4606..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,875 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeEach1", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeEach2", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeEach3", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, []), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUp", 0, [typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "SetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.TimeoutAttribute(30_000) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase1(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase1), "BeforeAll1", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase1.BeforeAll1(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase2(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase2), "BeforeAll2", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase2.BeforeAll2(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalBase3(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalBase3), "BeforeAll3", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalBase3.BeforeAll3(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUp", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUp(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_GlobalSetUpTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - new BeforeTestHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.BeforeTests.GlobalSetUpTests), "BeforeAllSetUpWithContext", 0, [typeof(global::TUnit.Core.TestContext), typeof(global::System.Threading.CancellationToken)]), - AsyncBody = (context, cancellationToken) => AsyncConvert.Convert(() => global::TUnit.TestProject.BeforeTests.GlobalSetUpTests.BeforeAllSetUpWithContext(context, cancellationToken)), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; -} -public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) -{ - return - [ - ]; -} -public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) -{ - return - [ - ]; -} -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt index 2a493fac6b..f1877c4606 100644 --- a/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/GlobalStaticBeforeEachTests.Test.verified.txt @@ -42,7 +42,7 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach1()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -103,7 +103,7 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach2()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -164,7 +164,7 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.BeforeEach3()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -225,7 +225,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp()), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -286,7 +286,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUp(cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -350,7 +350,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -411,7 +411,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato AsyncBody = (classInstance, context, cancellationToken) => AsyncConvert.Convert(() => classInstance.SetUpWithContext(context, cancellationToken)), HookExecutor = DefaultExecutor.Instance, Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.TimeoutAttribute(30_000) @@ -465,7 +465,7 @@ file partial class Hooks_GlobalBase1 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -528,7 +528,7 @@ file partial class Hooks_GlobalBase2 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 20, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -591,7 +591,7 @@ file partial class Hooks_GlobalBase3 : TUnit.Core.Interfaces.SourceGenerator.ITe Order = 0, FilePath = @"", LineNumber = 35, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -654,7 +654,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato Order = 0, FilePath = @"", LineNumber = 50, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -717,7 +717,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato Order = 0, FilePath = @"", LineNumber = 56, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -780,7 +780,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato Order = 0, FilePath = @"", LineNumber = 62, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], @@ -843,7 +843,7 @@ file partial class Hooks_GlobalSetUpTests : TUnit.Core.Interfaces.SourceGenerato Order = 0, FilePath = @"", LineNumber = 68, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.Test) { } ], diff --git a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt index 1706a9f804..53ca616b32 100644 --- a/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt @@ -37,7 +37,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute2 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -49,7 +52,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute3 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -61,7 +67,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute4 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerClass, +}; var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -73,7 +82,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute5 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "Key", +}; var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -85,7 +97,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute6 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -198,7 +213,10 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface global::System.String propertyArg1 = global::TUnit.TestProject.InheritedPropertySetterTests.MethodData(); var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute2 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -210,7 +228,10 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface }).ElementAtOrDefault(0)(); var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute3 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -222,7 +243,10 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface }).ElementAtOrDefault(0)(); var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute4 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerClass, +}; var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -234,7 +258,10 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface }).ElementAtOrDefault(0)(); var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute5 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "Key", +}; var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -246,7 +273,10 @@ file partial class Inherited_InheritedPropertySetterTests : TUnit.Core.Interface }).ElementAtOrDefault(0)(); var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute6 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, diff --git a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt index 54d2cb3fcd..4367bb97a5 100644 --- a/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/MultipleClassDataSourceDrivenTests.Test.verified.txt @@ -42,7 +42,10 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); @@ -155,7 +158,10 @@ file partial class MultipleClassDataSourceDrivenTests : TUnit.Core.Interfaces.So TestBuilderContext = testBuilderContextAccessor, TestSessionId = sessionId, }; - var classDataAttribute = typeof(global::TUnit.TestProject.MultipleClassDataSourceDrivenTests).GetCustomAttributes>(true).ElementAt(0); + var classDataAttribute = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = [global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None, global::TUnit.Core.SharedType.None], +}; var classArgGeneratedDataArray = classDataAttribute.GenerateDataSources(classArgDataGeneratorMetadata); diff --git a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt index aa5f3cb12f..64fd0b7fd0 100644 --- a/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/PropertySetterTests.Test.verified.txt @@ -37,7 +37,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I global::System.String propertyArg1 = global::TUnit.TestProject.PropertySetterTests.MethodData(); var propertyInfo2 = testClassType.GetProperty("Property3", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute2 = propertyInfo2.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute2 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + +}; var propertyArg2 = propertyDataAttribute2.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -49,7 +52,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo3 = testClassType.GetProperty("Property4", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute3 = propertyInfo3.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute3 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg3 = propertyDataAttribute3.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -61,7 +67,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo4 = testClassType.GetProperty("Property5", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute4 = propertyInfo4.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute4 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerClass, +}; var propertyArg4 = propertyDataAttribute4.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -73,7 +82,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo5 = testClassType.GetProperty("Property6", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute5 = propertyInfo5.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute5 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.Keyed, Key = "Key", +}; var propertyArg5 = propertyDataAttribute5.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, @@ -85,7 +97,10 @@ file partial class PropertySetterTests : TUnit.Core.Interfaces.SourceGenerator.I }).ElementAtOrDefault(0)(); var propertyInfo6 = testClassType.GetProperty("StaticProperty", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - var propertyDataAttribute6 = propertyInfo6.GetCustomAttributes>(true).ElementAt(0); + var propertyDataAttribute6 = new global::TUnit.Core.ClassDataSourceAttribute() +{ + Shared = global::TUnit.Core.SharedType.PerTestSession, +}; var propertyArg6 = propertyDataAttribute6.GenerateDataSources(new DataGeneratorMetadata { Type = TUnit.Core.Enums.DataGeneratorType.Property, diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt deleted file mode 100644 index b4da388f60..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,135 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_STAThreadTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "BeforeTest", 0, []), - Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), - HookExecutor = new global::TUnit.Core.STAThreadExecutor(), - Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.Executors.HookExecutorAttribute() -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") -{ - -} ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator.ITestHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_STAThreadTests(); - SourceRegistrar.RegisterTestHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterEveryTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectBeforeTestHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList CollectAfterTestHooks(string sessionId) - { - return - [ - new InstanceHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.STAThreadTests), "AfterTest", 0, []), - Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), - HookExecutor = new global::TUnit.Core.STAThreadExecutor(), - Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) -{ - -}, new global::TUnit.Core.Executors.HookExecutorAttribute() -{ - -} ], - ClassAttributes = [ new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility") -{ - -} ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt index 81ca525f1a..b4da388f60 100644 --- a/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.Test.verified.txt @@ -42,7 +42,7 @@ file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator. Body = (classInstance, context, cancellationToken) => classInstance.BeforeTest(), HookExecutor = new global::TUnit.Core.STAThreadExecutor(), Order = 0, - MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(0) + MethodAttributes = [ new global::TUnit.Core.BeforeAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.Executors.HookExecutorAttribute() @@ -115,7 +115,7 @@ file partial class Hooks_STAThreadTests : TUnit.Core.Interfaces.SourceGenerator. Body = (classInstance, context, cancellationToken) => classInstance.AfterTest(), HookExecutor = new global::TUnit.Core.STAThreadExecutor(), Order = 0, - MethodAttributes = [ new global::TUnit.Core.AfterAttribute(0) + MethodAttributes = [ new global::TUnit.Core.AfterAttribute(global::TUnit.Core.HookType.Test) { }, new global::TUnit.Core.Executors.HookExecutorAttribute() diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt deleted file mode 100644 index 41e945b477..0000000000 --- a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.DotNet9_0.received.txt +++ /dev/null @@ -1,103 +0,0 @@ -[ -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_TestDiscoveryHookTests(); - SourceRegistrar.RegisterTestDiscoveryHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) - { - return - [ - new global::TUnit.Core.Hooks.BeforeTestDiscoveryHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "BeforeDiscovery", 0, []), - Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.BeforeDiscovery(), - HookExecutor = DefaultExecutor.Instance, - Order = 5, - FilePath = @"", - LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) -{ - Order = 5, -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) - { - return - [ - ]; - } -} - - -// -#pragma warning disable -using global::System.Linq; -using global::System.Reflection; -using global::System.Runtime.CompilerServices; -using global::TUnit.Core; -using global::TUnit.Core.Hooks; -using global::TUnit.Core.Interfaces; - -namespace TUnit.SourceGenerated; - -[global::System.Diagnostics.StackTraceHidden] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGenerator.ITestDiscoveryHookSource -{ - [global::System.Runtime.CompilerServices.ModuleInitializer] - public static void Initialise() - { - var instance = new Hooks_TestDiscoveryHookTests(); - SourceRegistrar.RegisterTestDiscoveryHookSource(instance); - } - public global::System.Collections.Generic.IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId) - { - return - [ - ]; - } - public global::System.Collections.Generic.IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId) - { - return - [ - new global::TUnit.Core.Hooks.AfterTestDiscoveryHookMethod - { - MethodInfo = global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof(global::TUnit.TestProject.TestDiscoveryHookTests), "AfterDiscovery", 0, []), - Body = (context, cancellationToken) => global::TUnit.TestProject.TestDiscoveryHookTests.AfterDiscovery(), - HookExecutor = DefaultExecutor.Instance, - Order = 0, - FilePath = @"", - LineNumber = 10, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) -{ - -} ], - ClassAttributes = [ ], - AssemblyAttributes = [ ], - }, - ]; - } -} - -] \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt index 401c854288..41e945b477 100644 --- a/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt +++ b/TUnit.Core.SourceGenerator.Tests/TestDiscoveryHookTests.Test.verified.txt @@ -32,7 +32,7 @@ file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGe Order = 5, FilePath = @"", LineNumber = 5, - MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(4) + MethodAttributes = [ new global::TUnit.Core.BeforeEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) { Order = 5, } ], @@ -89,7 +89,7 @@ file partial class Hooks_TestDiscoveryHookTests : TUnit.Core.Interfaces.SourceGe Order = 0, FilePath = @"", LineNumber = 10, - MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(4) + MethodAttributes = [ new global::TUnit.Core.AfterEveryAttribute(global::TUnit.Core.HookType.TestDiscovery) { } ], From d2cbc9c2cdd9410e702ef6018b6d6ddd76823b4a Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:20:03 +0000 Subject: [PATCH 56/71] Fix --- .../Helpers/TestSourceDataModelRetriever.cs | 3 ++- .../Writers/FailedTestInitializationWriter.cs | 2 +- .../Writers/MethodInfoWriter.cs | 4 ++-- .../Models/TestSourceDataModel.cs | 5 ++-- TUnit.Core/Helpers/MethodInfoRetriever.cs | 23 +++++++++---------- TUnit.Core/TestMetadata.cs | 4 ++-- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs index ecb52e7dcb..765ee9a74f 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Helpers/TestSourceDataModelRetriever.cs @@ -154,7 +154,8 @@ private static TestSourceDataModel GetTestSourceDataModel(TestGenerationContext MethodArguments = testArguments, FilePath = testAttribute.ConstructorArguments[0].Value?.ToString() ?? string.Empty, LineNumber = testAttribute.ConstructorArguments[1].Value as int? ?? 0, - MethodParameterTypes = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], + MethodParameterTypes = [ ..methodSymbol.Parameters.Select(x => x.Type.GloballyQualified()) ], + MethodArgumentTypes = [..GetParameterTypes(methodSymbol, testArguments.GetArgumentTypes())], MethodParameterNames = [..methodSymbol.Parameters.Select(x => x.Name)], MethodGenericTypeCount = methodSymbol.TypeParameters.Length, TestExecutor = allAttributes.FirstOrDefault(x => x.AttributeClass?.IsOrInherits("global::TUnit.Core.Executors.TestExecutorAttribute") == true)?.AttributeClass?.TypeArguments.FirstOrDefault()?.GloballyQualified(), diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs index 5f8de4c81f..04326d9dd6 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/FailedTestInitializationWriter.cs @@ -15,7 +15,7 @@ public static void GenerateFailedTestCode(SourceCodeWriter sourceBuilder, sourceBuilder.WriteLine($"TestId = $\"{testId}\","); sourceBuilder.WriteLine($"TestClass = typeof({testSourceDataModel.FullyQualifiedTypeName}),"); sourceBuilder.WriteLine($"ReturnType = {MethodInfoWriter.Write(testSourceDataModel)}.ReturnType,"); - sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodParameterTypes.Select(x => $"typeof({x})"))}],"); + sourceBuilder.WriteLine($"ParameterTypeFullNames = [{string.Join(", ", testSourceDataModel.MethodArgumentTypes.Select(x => $"typeof({x})"))}],"); sourceBuilder.WriteLine($"TestName = \"{testSourceDataModel.MethodName}\","); sourceBuilder.WriteLine($"TestFilePath = @\"{testSourceDataModel.FilePath}\","); sourceBuilder.WriteLine($"TestLineNumber = {testSourceDataModel.LineNumber},"); diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs index 4d13ede9d9..b66b8c6316 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/MethodInfoWriter.cs @@ -6,11 +6,11 @@ public static class MethodInfoWriter { public static string Write(TestSourceDataModel testSourceDataModel) { - return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({testSourceDataModel.FullyQualifiedTypeName}), \"{testSourceDataModel.MethodName}\", {testSourceDataModel.MethodGenericTypeCount}, [{string.Join(", ", testSourceDataModel.MethodParameterTypes.Select(x => $"typeof({x})"))}])"; + return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({testSourceDataModel.FullyQualifiedTypeName}), \"{testSourceDataModel.MethodName}\", {testSourceDataModel.MethodGenericTypeCount}, [{string.Join(", ", testSourceDataModel.MethodArgumentTypes.Select(x => $"typeof({x})"))}])"; } public static string Write(HooksDataModel hooksDataModel) { - return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({hooksDataModel.FullyQualifiedTypeName}), \"{hooksDataModel.MethodName}\", 0, [{string.Join(", ", hooksDataModel.ParameterTypes.Select(x => $"typeof({x})"))}])"; + return $"global::TUnit.Core.Helpers.MethodInfoRetriever.GetMethodInfo(typeof({hooksDataModel.FullyQualifiedTypeName}), \"{hooksDataModel.MethodName}\", {hooksDataModel.Method.TypeParameters.Length}, [{string.Join(", ", hooksDataModel.ParameterTypes.Select(x => $"typeof({x})"))}])"; } } \ No newline at end of file diff --git a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs index 76835d9df9..39b7208f35 100644 --- a/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs +++ b/TUnit.Core.SourceGenerator/Models/TestSourceDataModel.cs @@ -30,7 +30,7 @@ public override int GetHashCode() hashCode = (hashCode * 397) ^ MethodName.GetHashCode(); hashCode = (hashCode * 397) ^ ClassArguments.GetHashCode(); hashCode = (hashCode * 397) ^ MethodArguments.GetHashCode(); - hashCode = (hashCode * 397) ^ MethodParameterTypes.GetHashCode(); + hashCode = (hashCode * 397) ^ MethodArgumentTypes.GetHashCode(); hashCode = (hashCode * 397) ^ MethodParameterNames.GetHashCode(); hashCode = (hashCode * 397) ^ MethodGenericTypeCount; hashCode = (hashCode * 397) ^ TestId.GetHashCode(); @@ -50,6 +50,7 @@ public override int GetHashCode() public required BaseContainer MethodArguments { get; init; } public required string[] MethodParameterTypes { get; init; } + public required string[] MethodArgumentTypes { get; init; } public required string[] MethodParameterNames { get; init; } public required int MethodGenericTypeCount { get; init; } @@ -80,7 +81,7 @@ public string MethodVariablesWithCancellationToken() ? argumentsContainer.DataVariables.Select(x => x.Name) : []; - if (MethodParameterTypes.Any(type => type == WellKnownFullyQualifiedClassNames.CancellationToken.WithGlobalPrefix)) + if (MethodArgumentTypes.Any(type => type == WellKnownFullyQualifiedClassNames.CancellationToken.WithGlobalPrefix)) { variableNames = [..variableNames, "cancellationToken"]; } diff --git a/TUnit.Core/Helpers/MethodInfoRetriever.cs b/TUnit.Core/Helpers/MethodInfoRetriever.cs index 04f6aabb4d..b8cfb7f759 100644 --- a/TUnit.Core/Helpers/MethodInfoRetriever.cs +++ b/TUnit.Core/Helpers/MethodInfoRetriever.cs @@ -5,26 +5,25 @@ namespace TUnit.Core.Helpers; public class MethodInfoRetriever { - public static MethodInfo? GetMethodInfo([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, + public static MethodInfo GetMethodInfo([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string methodName, int genericParameterCount, Type[] parameterTypes) { -#if NET - - return type.GetMethod(methodName, genericParameterCount, parameterTypes); -#else if (genericParameterCount == 0) { - return type.GetMethod(methodName, parameterTypes); + return type.GetMethod(methodName, parameterTypes) + ?? throw new ArgumentException( + $"Method not found: {type}.{methodName}({string.Join(", ", parameterTypes.Select(x => x.Name))})"); } return type - .GetMethods() - .Where(x => x.Name == methodName) - .Where(x => x.IsGenericMethod) - .Where(x => x.GetGenericArguments().Length == genericParameterCount) - .FirstOrDefault(x => x.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes)); -#endif + .GetMethods() + .Where(x => x.Name == methodName) + .Where(x => x.IsGenericMethod) + .Where(x => x.GetGenericArguments().Length == genericParameterCount) + .FirstOrDefault(x => x.GetParameters().Length == parameterTypes.Length) + ?? throw new ArgumentException($"Method not found: {type}.{methodName}({string.Join(", ", parameterTypes.Select(x => x.Name))})"); + } } \ No newline at end of file diff --git a/TUnit.Core/TestMetadata.cs b/TUnit.Core/TestMetadata.cs index a4349b65ae..f47a9742cc 100644 --- a/TUnit.Core/TestMetadata.cs +++ b/TUnit.Core/TestMetadata.cs @@ -20,7 +20,7 @@ public override TestDetails BuildTestDetails() var testDetails = new TestDetails { TestId = testId, - LazyClassInstance = ResettableClassFactory!, + LazyClassInstance = ResettableClassFactory, ClassType = classType, AssemblyAttributes = AssemblyAttributes, ClassAttributes = ClassAttributes, @@ -57,7 +57,7 @@ public override TestMetadata CloneWithNewMethodFactory(Func testMethodFactory.Invoke(@class!, token), + TestMethodFactory = testMethodFactory.Invoke, ResettableClassFactory = ResettableClassFactory.Clone() }; } From 7d7c23c7056f9360e9bcc32289c3ff6d5fb07d95 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:27:38 +0000 Subject: [PATCH 57/71] Fix --- .../ClassTupleDataSourceDrivenTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs index 2c4754e7da..4a1ab08ddc 100644 --- a/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs +++ b/TUnit.Core.SourceGenerator.Tests/ClassTupleDataSourceDrivenTests.cs @@ -1,4 +1,3 @@ -using TUnit.Assertions.Extensions; using TUnit.Core.SourceGenerator.CodeGenerators; namespace TUnit.Core.SourceGenerator.Tests; @@ -12,6 +11,5 @@ public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, async generatedFiles => { await Assert.That(generatedFiles.Length).IsEqualTo(1); - await Verify(generatedFiles); }); } \ No newline at end of file From d2b9bea22512d79e3da64fbc2645223165abf925 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:31:14 +0000 Subject: [PATCH 58/71] record --- TUnit.Core/DiscoveredTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index 505efc32a7..5bd961894d 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -2,7 +2,7 @@ namespace TUnit.Core; -internal class DiscoveredTest< +internal record DiscoveredTest< [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis .DynamicallyAccessedMemberTypes.All)] TTestClass @@ -25,7 +25,7 @@ public override async Task ResetTestInstance() public override IClassConstructor? ClassConstructor => resettableLazyTestClassFactory.ClassConstructor; } -internal abstract class DiscoveredTest +internal abstract record DiscoveredTest { public required TestContext TestContext { get; init; } From 59febcbc1c28abe1e89fbbb4c00bb13f9b5b0df1 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:46:18 +0000 Subject: [PATCH 59/71] IComparable --- TUnit.Core/DiscoveredTest.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index 5bd961894d..9a7a4ffa40 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -25,7 +25,7 @@ public override async Task ResetTestInstance() public override IClassConstructor? ClassConstructor => resettableLazyTestClassFactory.ClassConstructor; } -internal abstract record DiscoveredTest +internal abstract record DiscoveredTest : IComparable { public required TestContext TestContext { get; init; } @@ -40,4 +40,13 @@ internal abstract record DiscoveredTest public abstract IClassConstructor? ClassConstructor { get; } public IHookExecutor? HookExecutor { get; internal set; } + public int CompareTo(object obj) + { + return CompareTo(obj as DiscoveredTest); + } + + public int CompareTo(DiscoveredTest? other) + { + return string.Compare(other?.TestDetails.TestId, TestDetails.TestId, StringComparison.Ordinal); + } } \ No newline at end of file From 994aff387ccebf3c0c5c2292e5539f9ebc776b47 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:56:15 +0000 Subject: [PATCH 60/71] IComparable --- TUnit.Core/DiscoveredTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index 9a7a4ffa40..59d484f390 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -25,7 +25,7 @@ public override async Task ResetTestInstance() public override IClassConstructor? ClassConstructor => resettableLazyTestClassFactory.ClassConstructor; } -internal abstract record DiscoveredTest : IComparable +internal abstract record DiscoveredTest : IComparable, IComparable { public required TestContext TestContext { get; init; } From 653e587d2d428e7457bc0bc31d3122d1a00d5459 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:02:10 +0000 Subject: [PATCH 61/71] Tweak --- TUnit.Core/DiscoveredTest.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index 59d484f390..bfec3c7cbd 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -40,13 +40,18 @@ internal abstract record DiscoveredTest : IComparable, IComparab public abstract IClassConstructor? ClassConstructor { get; } public IHookExecutor? HookExecutor { get; internal set; } - public int CompareTo(object obj) + public int CompareTo(object? obj) { - return CompareTo(obj as DiscoveredTest); + if (obj is null) + { + return -1; + } + + return CompareTo((DiscoveredTest)obj); } - public int CompareTo(DiscoveredTest? other) + public int CompareTo(DiscoveredTest other) { - return string.Compare(other?.TestDetails.TestId, TestDetails.TestId, StringComparison.Ordinal); + return string.Compare(other.TestDetails.TestId, TestDetails.TestId, StringComparison.Ordinal); } } \ No newline at end of file From 7484f2faf2a0a88f91dd2d73b77669eb97d2a821 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:04:55 +0000 Subject: [PATCH 62/71] Tweak --- TUnit.Core/DiscoveredTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index bfec3c7cbd..23e3c59211 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -50,8 +50,8 @@ public int CompareTo(object? obj) return CompareTo((DiscoveredTest)obj); } - public int CompareTo(DiscoveredTest other) + public int CompareTo(DiscoveredTest? other) { - return string.Compare(other.TestDetails.TestId, TestDetails.TestId, StringComparison.Ordinal); + return string.Compare(other?.TestDetails.TestId, TestDetails.TestId, StringComparison.Ordinal); } } \ No newline at end of file From 6d61baf271c5a5a775eda16e616c03b0a82a4c31 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:23:39 +0000 Subject: [PATCH 63/71] IComparable --- .../Models/ConstraintKeysCollection.cs | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/TUnit.Engine/Models/ConstraintKeysCollection.cs b/TUnit.Engine/Models/ConstraintKeysCollection.cs index 3e3bc1a54d..93c875406d 100644 --- a/TUnit.Engine/Models/ConstraintKeysCollection.cs +++ b/TUnit.Engine/Models/ConstraintKeysCollection.cs @@ -3,7 +3,7 @@ namespace TUnit.Engine.Models; internal class ConstraintKeysCollection(IReadOnlyList constraintKeys) - : IReadOnlyList, IEquatable + : IReadOnlyList, IEquatable, IComparable, IComparable { private readonly IReadOnlyList _constraintKeys = constraintKeys; @@ -27,6 +27,16 @@ public bool Equals(ConstraintKeysCollection? other) return _constraintKeys.Intersect(other._constraintKeys).Any(); } + public int CompareTo(ConstraintKeysCollection other) + { + if (Equals(other, null)) + { + return 0; + } + + return -1; + } + public override bool Equals(object? obj) { if (ReferenceEquals(null, obj)) @@ -52,6 +62,16 @@ public override int GetHashCode() return 1; } + public int CompareTo(object? obj) + { + if (obj is null) + { + return -1; + } + + return CompareTo((ConstraintKeysCollection)obj); + } + public static bool operator ==(ConstraintKeysCollection? left, ConstraintKeysCollection? right) { return Equals(left, right); From 926bcd0b7a5246dc0fb0e33510aab68f1ba82015 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:26:32 +0000 Subject: [PATCH 64/71] Nullable --- TUnit.Engine/Models/ConstraintKeysCollection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TUnit.Engine/Models/ConstraintKeysCollection.cs b/TUnit.Engine/Models/ConstraintKeysCollection.cs index 93c875406d..fc347256ea 100644 --- a/TUnit.Engine/Models/ConstraintKeysCollection.cs +++ b/TUnit.Engine/Models/ConstraintKeysCollection.cs @@ -27,7 +27,7 @@ public bool Equals(ConstraintKeysCollection? other) return _constraintKeys.Intersect(other._constraintKeys).Any(); } - public int CompareTo(ConstraintKeysCollection other) + public int CompareTo(ConstraintKeysCollection? other) { if (Equals(other, null)) { From 86ec3223bd632b80ba75bb8209699237b394497e Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:42:00 +0000 Subject: [PATCH 65/71] TargetFrameworks --- .../TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj | 2 ++ .../TUnit.NugetTester/TUnit.NugetTester.csproj | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj index b81e362ab7..058a26ba8f 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj @@ -1,6 +1,8 @@  + net472; net8.0; net9.0 + latest true enable enable diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj index 5de9af9964..ceaa37029f 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj @@ -1,6 +1,8 @@  + net472; net8.0; net9.0 + latest Exe true enable From 6d29aa5d29c82fce20ffb5c05fe104ac1c04275a Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:42:56 +0000 Subject: [PATCH 66/71] return early --- .../CodeGenerators/Writers/AttributeWriter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs index 64e2db23ab..dc8813519b 100644 --- a/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs +++ b/TUnit.Core.SourceGenerator/CodeGenerators/Writers/AttributeWriter.cs @@ -19,7 +19,8 @@ public static string[] WriteAttributes(GeneratorAttributeSyntaxContext context, public static string WriteAttribute(GeneratorAttributeSyntaxContext context, AttributeData attributeData) { - if (attributeData.ApplicationSyntaxReference is null) + if (attributeData.ApplicationSyntaxReference is null + || attributeData.AttributeClass?.ContainingAssembly?.Name == "System.Runtime") { return string.Empty; } From 44fb07fd3e3bbfb951e684f6a3f9e143bf403d28 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:20:25 +0000 Subject: [PATCH 67/71] IComparable --- TUnit.Core/DiscoveredTest.cs | 8 ++------ TUnit.Core/ParallelGroupConstraint.cs | 15 ++++++++++++++- TUnit.Engine/Models/ConstraintKeysCollection.cs | 12 +++++------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/TUnit.Core/DiscoveredTest.cs b/TUnit.Core/DiscoveredTest.cs index 23e3c59211..8cb8fab581 100644 --- a/TUnit.Core/DiscoveredTest.cs +++ b/TUnit.Core/DiscoveredTest.cs @@ -40,14 +40,10 @@ internal abstract record DiscoveredTest : IComparable, IComparab public abstract IClassConstructor? ClassConstructor { get; } public IHookExecutor? HookExecutor { get; internal set; } + public int CompareTo(object? obj) { - if (obj is null) - { - return -1; - } - - return CompareTo((DiscoveredTest)obj); + return CompareTo(obj as DiscoveredTest); } public int CompareTo(DiscoveredTest? other) diff --git a/TUnit.Core/ParallelGroupConstraint.cs b/TUnit.Core/ParallelGroupConstraint.cs index d8db628e00..4edc3a0212 100644 --- a/TUnit.Core/ParallelGroupConstraint.cs +++ b/TUnit.Core/ParallelGroupConstraint.cs @@ -2,4 +2,17 @@ namespace TUnit.Core; -public record ParallelGroupConstraint(string Group) : IParallelConstraint; \ No newline at end of file +public record ParallelGroupConstraint(string Group) : IParallelConstraint, + IComparable, + IComparable +{ + public int CompareTo(ParallelGroupConstraint? other) + { + return string.Compare(Group, other?.Group, StringComparison.Ordinal); + } + + public int CompareTo(object? obj) + { + return CompareTo(obj as ParallelGroupConstraint); + } +} \ No newline at end of file diff --git a/TUnit.Engine/Models/ConstraintKeysCollection.cs b/TUnit.Engine/Models/ConstraintKeysCollection.cs index fc347256ea..4c1a4d1e2c 100644 --- a/TUnit.Engine/Models/ConstraintKeysCollection.cs +++ b/TUnit.Engine/Models/ConstraintKeysCollection.cs @@ -3,7 +3,10 @@ namespace TUnit.Engine.Models; internal class ConstraintKeysCollection(IReadOnlyList constraintKeys) - : IReadOnlyList, IEquatable, IComparable, IComparable + : IReadOnlyList, + IEquatable, + IComparable, + IComparable { private readonly IReadOnlyList _constraintKeys = constraintKeys; @@ -64,12 +67,7 @@ public override int GetHashCode() public int CompareTo(object? obj) { - if (obj is null) - { - return -1; - } - - return CompareTo((ConstraintKeysCollection)obj); + return CompareTo(obj as ConstraintKeysCollection); } public static bool operator ==(ConstraintKeysCollection? left, ConstraintKeysCollection? right) From e8858a4ab261b4cdbb4c0c9154433d1aa5ec50ae Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:32:56 +0000 Subject: [PATCH 68/71] New PriorityQueue implementation --- TUnit.Engine/PriorityQueue.cs | 127 +++++++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 33 deletions(-) diff --git a/TUnit.Engine/PriorityQueue.cs b/TUnit.Engine/PriorityQueue.cs index efcc591e67..0d9787d6b8 100644 --- a/TUnit.Engine/PriorityQueue.cs +++ b/TUnit.Engine/PriorityQueue.cs @@ -1,53 +1,114 @@ -#if !NET +using System.Diagnostics.CodeAnalysis; -using C5; -using System.Diagnostics.CodeAnalysis; +#if !NET -namespace TUnit.Engine; - -class PriorityQueue +namespace TUnit.Engine { - struct Element : IComparer + public class PriorityQueue where TPriority : IComparable { - public TElement Value; - public TPriority Priority; + private readonly List _elements = []; - public Element(TElement value, TPriority priority) + private struct Element(TElement value, TPriority priority) { - Value = value; - Priority = priority; + public readonly TElement Value = value; + public readonly TPriority Priority = priority; } - public int Compare(Element x, Element y) + + public int Count => _elements.Count; + + public void Enqueue(TElement value, TPriority priority) { - return Comparer.Default.Compare(x.Priority, y.Priority); + var element = new Element(value, priority); + _elements.Add(element); + HeapifyUp(_elements.Count - 1); } - } - private IPriorityQueue list; + public TElement Dequeue() + { + if (_elements.Count == 0) + { + throw new InvalidOperationException("The priority queue is empty."); + } - public PriorityQueue() - { - this.list = new C5.IntervalHeap(); - } + var element = _elements[0]; + _elements[0] = _elements[^1]; + _elements.RemoveAt(_elements.Count - 1); + HeapifyDown(0); - public void Enqueue(TElement item, TPriority priority) - { - list.Add(new Element(item, priority)); - } - - public bool TryDequeue([MaybeNullWhen(false)] out TElement item, [MaybeNullWhen(false)] out TPriority priority) - { - if (list.Count > 0) + return element.Value; + } + + public bool TryDequeue([NotNullWhen(true)] out TElement? value, [NotNullWhen(true)] out TPriority? priority) { - Element element = list.DeleteMin(); - item = element.Value; + if (_elements.Count == 0) + { + value = default; + priority = default; + return false; + } + + var element = _elements[0]; + _elements[0] = _elements[^1]; + _elements.RemoveAt(_elements.Count - 1); + HeapifyDown(0); + + value = element.Value!; priority = element.Priority; return true; } - item = default; - priority = default; - return false; + public TElement Peek() + { + if (_elements.Count == 0) + { + throw new InvalidOperationException("The priority queue is empty."); + } + + return _elements[0].Value; + } + + private void HeapifyUp(int index) + { + while (index > 0) + { + var parentIndex = (index - 1) / 2; + if (_elements[index].Priority.CompareTo(_elements[parentIndex].Priority) >= 0) + { + break; + } + + Swap(index, parentIndex); + index = parentIndex; + } + } + + private void HeapifyDown(int index) + { + while (index < _elements.Count / 2) + { + var leftChildIndex = 2 * index + 1; + var rightChildIndex = 2 * index + 2; + var smallestChildIndex = leftChildIndex; + + if (rightChildIndex < _elements.Count && _elements[rightChildIndex].Priority.CompareTo(_elements[leftChildIndex].Priority) < 0) + { + smallestChildIndex = rightChildIndex; + } + + if (_elements[index].Priority.CompareTo(_elements[smallestChildIndex].Priority) <= 0) + { + break; + } + + Swap(index, smallestChildIndex); + index = smallestChildIndex; + } + } + + private void Swap(int index1, int index2) + { + (_elements[index1], _elements[index2]) = (_elements[index2], _elements[index1]); + } } } From 29b4fd25e5eb46572eea0db7e573232e3ea12364 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:49:43 +0000 Subject: [PATCH 69/71] Remove C5 --- Directory.Packages.props | 1 - TUnit.Engine/TUnit.Engine.csproj | 1 - TUnit.Pipeline/Modules/TestNugetPackageModule.cs | 10 +++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5773a577a3..a5b4e6b77f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,6 @@ - diff --git a/TUnit.Engine/TUnit.Engine.csproj b/TUnit.Engine/TUnit.Engine.csproj index b4dec4b2eb..d63664fd72 100644 --- a/TUnit.Engine/TUnit.Engine.csproj +++ b/TUnit.Engine/TUnit.Engine.csproj @@ -12,7 +12,6 @@ - diff --git a/TUnit.Pipeline/Modules/TestNugetPackageModule.cs b/TUnit.Pipeline/Modules/TestNugetPackageModule.cs index ae19561623..9fed7ad0c7 100644 --- a/TUnit.Pipeline/Modules/TestNugetPackageModule.cs +++ b/TUnit.Pipeline/Modules/TestNugetPackageModule.cs @@ -14,8 +14,16 @@ namespace TUnit.Pipeline.Modules; [DependsOn] public class TestNugetPackageModule : Module { - private readonly string[] _frameworks = ["net8.0", "net9.0", "net472"]; + private readonly List _frameworks = ["net8.0", "net9.0"]; + public TestNugetPackageModule() + { + if (Environment.GetEnvironmentVariable("NET_VERSION") == "net472") + { + _frameworks.Add("net472"); + } + } + protected override async Task ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken) { From ffcbccffb092018dcc53b89326b1e49af988c446 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:16:13 +0000 Subject: [PATCH 70/71] Update TUnit.NugetTester.Library.csproj --- .../TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj index 058a26ba8f..650af02674 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.Library/TUnit.NugetTester.Library.csproj @@ -12,6 +12,7 @@ $(TUnitVersion) + From 9970991d3a92da4afba994556f71dd0becee7f38 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:17:09 +0000 Subject: [PATCH 71/71] Update TUnit.NugetTester.csproj --- .../TUnit.NugetTester/TUnit.NugetTester.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj index ceaa37029f..8d7507d356 100644 --- a/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj +++ b/tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/TUnit.NugetTester.csproj @@ -12,7 +12,8 @@ $(TUnitVersion) - + +