From 631e539b6d0e32879909cb415e18da51c6e048e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:12:41 +0000 Subject: [PATCH 1/5] Initial plan From bf9fd84d3f5837bbd43ca4b415dd10a1b9786131 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:33:55 +0000 Subject: [PATCH 2/5] Add ArrayAssertion and update Assert.That(TItem[]) to return it This enables [GenerateAssertion] extensions targeting concrete array types (e.g., string[]) to work with Assert.That(array), by ensuring the returned assertion type implements IAssertionSource. Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com> --- .../MethodAssertionGeneratorTests.cs | 17 +++++++++++ .../TestData/ArrayTargetAssertion.cs | 16 ++++++++++ TUnit.Assertions/Extensions/Assert.cs | 7 +++-- TUnit.Assertions/Sources/ArrayAssertion.cs | 30 +++++++++++++++++++ 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 TUnit.Assertions.SourceGenerator.Tests/TestData/ArrayTargetAssertion.cs create mode 100644 TUnit.Assertions/Sources/ArrayAssertion.cs diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs index 565893474b..b1289476af 100644 --- a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs @@ -234,4 +234,21 @@ public Task RefStructParameter() => RunTest( await Assert.That(mainFile).Contains("value!.Contains(_message)"); }); #endif + + [Test] + public Task ArrayTargetType() => RunTest( + Path.Combine(Sourcy.Git.RootDirectory.FullName, + "TUnit.Assertions.SourceGenerator.Tests", + "TestData", + "ArrayTargetAssertion.cs"), + async generatedFiles => + { + await Assert.That(generatedFiles).HasCount(1); + + var mainFile = generatedFiles.FirstOrDefault(f => f.Contains("ContainsMessage")); + await Assert.That(mainFile).IsNotNull(); + // Verify extension method targets IAssertionSource + await Assert.That(mainFile!).Contains("IAssertionSource"); + await Assert.That(mainFile!).Contains("StringArray_ContainsMessage_String_Boolean_Assertion"); + }); } diff --git a/TUnit.Assertions.SourceGenerator.Tests/TestData/ArrayTargetAssertion.cs b/TUnit.Assertions.SourceGenerator.Tests/TestData/ArrayTargetAssertion.cs new file mode 100644 index 0000000000..50870f537a --- /dev/null +++ b/TUnit.Assertions.SourceGenerator.Tests/TestData/ArrayTargetAssertion.cs @@ -0,0 +1,16 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions.Tests.TestData; + +/// +/// Test case: GenerateAssertion targeting a concrete array type (string[]) +/// Should generate Assertion class and extension method using IAssertionSource<string[]> +/// +public static partial class ArrayTargetAssertionExtensions +{ + [GenerateAssertion(ExpectationMessage = "to contain message '{needle}'")] + public static bool ContainsMessage(this string[] strings, string needle, bool exact = true) + { + return strings.Any(x => exact ? x == needle : x.Contains(needle)); + } +} diff --git a/TUnit.Assertions/Extensions/Assert.cs b/TUnit.Assertions/Extensions/Assert.cs index f4c9ba9ff4..56ef942c59 100644 --- a/TUnit.Assertions/Extensions/Assert.cs +++ b/TUnit.Assertions/Extensions/Assert.cs @@ -190,15 +190,16 @@ public static ListAssertion That( /// /// Creates an assertion for an array value. - /// Arrays are routed to CollectionAssertion to preserve array-specific generated assertions. + /// Returns ArrayAssertion which implements IAssertionSource<TItem[]>, + /// enabling generated assertions that target concrete array types (e.g., string[]). /// Example: await Assert.That(array).IsSingleElement(); /// [OverloadResolutionPriority(5)] - public static CollectionAssertion That( + public static ArrayAssertion That( TItem[]? value, [CallerArgumentExpression(nameof(value))] string? expression = null) { - return new CollectionAssertion(value!, expression); + return new ArrayAssertion(value, expression); } /// diff --git a/TUnit.Assertions/Sources/ArrayAssertion.cs b/TUnit.Assertions/Sources/ArrayAssertion.cs new file mode 100644 index 0000000000..6efe0fc411 --- /dev/null +++ b/TUnit.Assertions/Sources/ArrayAssertion.cs @@ -0,0 +1,30 @@ +using System.Text; +using TUnit.Assertions.Core; + +namespace TUnit.Assertions.Sources; + +/// +/// Source assertion for array values. +/// This is the entry point for: Assert.That(array) +/// Inherits from CollectionAssertionBase<TItem[], TItem> to get IAssertionSource<TItem[]>, +/// enabling generated assertions that target concrete array types (e.g., string[]). +/// +public class ArrayAssertion : CollectionAssertionBase +{ + public ArrayAssertion(TItem[]? value, string? expression) + : base(new AssertionContext(value!, CreateExpressionBuilder(expression))) + { + } + + internal ArrayAssertion(AssertionContext context) + : base(context) + { + } + + private static StringBuilder CreateExpressionBuilder(string? expression) + { + var builder = new StringBuilder(); + builder.Append($"Assert.That({expression ?? "?"})"); + return builder; + } +} From 38152b512112bd473609f2b59d061672bcdae4e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:06:38 +0000 Subject: [PATCH 3/5] Add snapshot files, integration tests, and fix array type naming in source generator - Add .verified.txt snapshot files for ArrayTargetType test across all frameworks - Add GenerateAssertionArrayTests with 3 integration tests that call generated assertions - Fix GetSimpleTypeName to handle IArrayTypeSymbol (string[] -> StringArray) - Fix test assertion to use correct class name (Bool not Boolean) Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com> --- ...ts.ArrayTargetType.DotNet10_0.verified.txt | 69 +++++++++++++++++++ ...sts.ArrayTargetType.DotNet8_0.verified.txt | 69 +++++++++++++++++++ ...sts.ArrayTargetType.DotNet9_0.verified.txt | 69 +++++++++++++++++++ ...rTests.ArrayTargetType.Net4_7.verified.txt | 69 +++++++++++++++++++ .../MethodAssertionGeneratorTests.cs | 2 +- .../Generators/MethodAssertionGenerator.cs | 6 ++ .../GenerateAssertionArrayTests.cs | 43 ++++++++++++ 7 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet10_0.verified.txt create mode 100644 TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet8_0.verified.txt create mode 100644 TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet9_0.verified.txt create mode 100644 TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.Net4_7.verified.txt create mode 100644 TUnit.Assertions.Tests/GenerateAssertionArrayTests.cs diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet10_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet10_0.verified.txt new file mode 100644 index 0000000000..2eaba629d7 --- /dev/null +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet10_0.verified.txt @@ -0,0 +1,69 @@ +[ +#nullable enable + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using TUnit.Assertions.Core; +using TUnit.Assertions.Tests.TestData; + +namespace TUnit.Assertions.Extensions; + +/// +/// Generated assertion for ContainsMessage +/// +public sealed class StringArray_ContainsMessage_String_Bool_Assertion : Assertion +{ + private static readonly Task _passedTask = Task.FromResult(AssertionResult.Passed); + + private readonly string _needle; + private readonly bool _exact; + + public StringArray_ContainsMessage_String_Bool_Assertion(AssertionContext context, string needle, bool exact) + : base(context) + { + _needle = needle; + _exact = exact; + } + + protected override Task CheckAsync(EvaluationMetadata metadata) + { + var value = metadata.Value; + var exception = metadata.Exception; + + if (exception != null) + { + return Task.FromResult(AssertionResult.Failed($"threw {exception.GetType().FullName}")); + } + + if (value is null) + { + return Task.FromResult(AssertionResult.Failed("Actual value is null")); + } + + var result = value!.ContainsMessage(_needle, _exact); + return result + ? _passedTask + : Task.FromResult(AssertionResult.Failed($"found {value}")); + } + + protected override string GetExpectation() + { + return $"to contain message '{_needle}'"; + } +} + +public static partial class ArrayTargetAssertionExtensions +{ + /// + /// Generated extension method for ContainsMessage + /// + public static StringArray_ContainsMessage_String_Bool_Assertion ContainsMessage(this IAssertionSource source, string needle, bool exact, [CallerArgumentExpression(nameof(needle))] string? needleExpression = null, [CallerArgumentExpression(nameof(exact))] string? exactExpression = null) + { + source.Context.ExpressionBuilder.Append($".ContainsMessage({needleExpression}, {exactExpression})"); + return new StringArray_ContainsMessage_String_Bool_Assertion(source.Context, needle, exact); + } + +} + +] \ No newline at end of file diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet8_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet8_0.verified.txt new file mode 100644 index 0000000000..2eaba629d7 --- /dev/null +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet8_0.verified.txt @@ -0,0 +1,69 @@ +[ +#nullable enable + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using TUnit.Assertions.Core; +using TUnit.Assertions.Tests.TestData; + +namespace TUnit.Assertions.Extensions; + +/// +/// Generated assertion for ContainsMessage +/// +public sealed class StringArray_ContainsMessage_String_Bool_Assertion : Assertion +{ + private static readonly Task _passedTask = Task.FromResult(AssertionResult.Passed); + + private readonly string _needle; + private readonly bool _exact; + + public StringArray_ContainsMessage_String_Bool_Assertion(AssertionContext context, string needle, bool exact) + : base(context) + { + _needle = needle; + _exact = exact; + } + + protected override Task CheckAsync(EvaluationMetadata metadata) + { + var value = metadata.Value; + var exception = metadata.Exception; + + if (exception != null) + { + return Task.FromResult(AssertionResult.Failed($"threw {exception.GetType().FullName}")); + } + + if (value is null) + { + return Task.FromResult(AssertionResult.Failed("Actual value is null")); + } + + var result = value!.ContainsMessage(_needle, _exact); + return result + ? _passedTask + : Task.FromResult(AssertionResult.Failed($"found {value}")); + } + + protected override string GetExpectation() + { + return $"to contain message '{_needle}'"; + } +} + +public static partial class ArrayTargetAssertionExtensions +{ + /// + /// Generated extension method for ContainsMessage + /// + public static StringArray_ContainsMessage_String_Bool_Assertion ContainsMessage(this IAssertionSource source, string needle, bool exact, [CallerArgumentExpression(nameof(needle))] string? needleExpression = null, [CallerArgumentExpression(nameof(exact))] string? exactExpression = null) + { + source.Context.ExpressionBuilder.Append($".ContainsMessage({needleExpression}, {exactExpression})"); + return new StringArray_ContainsMessage_String_Bool_Assertion(source.Context, needle, exact); + } + +} + +] \ No newline at end of file diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet9_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet9_0.verified.txt new file mode 100644 index 0000000000..2eaba629d7 --- /dev/null +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.DotNet9_0.verified.txt @@ -0,0 +1,69 @@ +[ +#nullable enable + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using TUnit.Assertions.Core; +using TUnit.Assertions.Tests.TestData; + +namespace TUnit.Assertions.Extensions; + +/// +/// Generated assertion for ContainsMessage +/// +public sealed class StringArray_ContainsMessage_String_Bool_Assertion : Assertion +{ + private static readonly Task _passedTask = Task.FromResult(AssertionResult.Passed); + + private readonly string _needle; + private readonly bool _exact; + + public StringArray_ContainsMessage_String_Bool_Assertion(AssertionContext context, string needle, bool exact) + : base(context) + { + _needle = needle; + _exact = exact; + } + + protected override Task CheckAsync(EvaluationMetadata metadata) + { + var value = metadata.Value; + var exception = metadata.Exception; + + if (exception != null) + { + return Task.FromResult(AssertionResult.Failed($"threw {exception.GetType().FullName}")); + } + + if (value is null) + { + return Task.FromResult(AssertionResult.Failed("Actual value is null")); + } + + var result = value!.ContainsMessage(_needle, _exact); + return result + ? _passedTask + : Task.FromResult(AssertionResult.Failed($"found {value}")); + } + + protected override string GetExpectation() + { + return $"to contain message '{_needle}'"; + } +} + +public static partial class ArrayTargetAssertionExtensions +{ + /// + /// Generated extension method for ContainsMessage + /// + public static StringArray_ContainsMessage_String_Bool_Assertion ContainsMessage(this IAssertionSource source, string needle, bool exact, [CallerArgumentExpression(nameof(needle))] string? needleExpression = null, [CallerArgumentExpression(nameof(exact))] string? exactExpression = null) + { + source.Context.ExpressionBuilder.Append($".ContainsMessage({needleExpression}, {exactExpression})"); + return new StringArray_ContainsMessage_String_Bool_Assertion(source.Context, needle, exact); + } + +} + +] \ No newline at end of file diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.Net4_7.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.Net4_7.verified.txt new file mode 100644 index 0000000000..2eaba629d7 --- /dev/null +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.ArrayTargetType.Net4_7.verified.txt @@ -0,0 +1,69 @@ +[ +#nullable enable + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using TUnit.Assertions.Core; +using TUnit.Assertions.Tests.TestData; + +namespace TUnit.Assertions.Extensions; + +/// +/// Generated assertion for ContainsMessage +/// +public sealed class StringArray_ContainsMessage_String_Bool_Assertion : Assertion +{ + private static readonly Task _passedTask = Task.FromResult(AssertionResult.Passed); + + private readonly string _needle; + private readonly bool _exact; + + public StringArray_ContainsMessage_String_Bool_Assertion(AssertionContext context, string needle, bool exact) + : base(context) + { + _needle = needle; + _exact = exact; + } + + protected override Task CheckAsync(EvaluationMetadata metadata) + { + var value = metadata.Value; + var exception = metadata.Exception; + + if (exception != null) + { + return Task.FromResult(AssertionResult.Failed($"threw {exception.GetType().FullName}")); + } + + if (value is null) + { + return Task.FromResult(AssertionResult.Failed("Actual value is null")); + } + + var result = value!.ContainsMessage(_needle, _exact); + return result + ? _passedTask + : Task.FromResult(AssertionResult.Failed($"found {value}")); + } + + protected override string GetExpectation() + { + return $"to contain message '{_needle}'"; + } +} + +public static partial class ArrayTargetAssertionExtensions +{ + /// + /// Generated extension method for ContainsMessage + /// + public static StringArray_ContainsMessage_String_Bool_Assertion ContainsMessage(this IAssertionSource source, string needle, bool exact, [CallerArgumentExpression(nameof(needle))] string? needleExpression = null, [CallerArgumentExpression(nameof(exact))] string? exactExpression = null) + { + source.Context.ExpressionBuilder.Append($".ContainsMessage({needleExpression}, {exactExpression})"); + return new StringArray_ContainsMessage_String_Bool_Assertion(source.Context, needle, exact); + } + +} + +] \ No newline at end of file diff --git a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs index b1289476af..0f331b922e 100644 --- a/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs +++ b/TUnit.Assertions.SourceGenerator.Tests/MethodAssertionGeneratorTests.cs @@ -249,6 +249,6 @@ public Task ArrayTargetType() => RunTest( await Assert.That(mainFile).IsNotNull(); // Verify extension method targets IAssertionSource await Assert.That(mainFile!).Contains("IAssertionSource"); - await Assert.That(mainFile!).Contains("StringArray_ContainsMessage_String_Boolean_Assertion"); + await Assert.That(mainFile!).Contains("StringArray_ContainsMessage_String_Bool_Assertion"); }); } diff --git a/TUnit.Assertions.SourceGenerator/Generators/MethodAssertionGenerator.cs b/TUnit.Assertions.SourceGenerator/Generators/MethodAssertionGenerator.cs index f73d463376..1262671901 100644 --- a/TUnit.Assertions.SourceGenerator/Generators/MethodAssertionGenerator.cs +++ b/TUnit.Assertions.SourceGenerator/Generators/MethodAssertionGenerator.cs @@ -1026,6 +1026,12 @@ private static ImmutableEquatableArray GetGenericTypeParameters(ITypeSym private static string GetSimpleTypeName(ITypeSymbol type) { + // Handle array types: string[] becomes StringArray + if (type is IArrayTypeSymbol arrayType) + { + return $"{GetSimpleTypeName(arrayType.ElementType)}Array"; + } + // Handle special types first var simpleName = type.SpecialType switch { diff --git a/TUnit.Assertions.Tests/GenerateAssertionArrayTests.cs b/TUnit.Assertions.Tests/GenerateAssertionArrayTests.cs new file mode 100644 index 0000000000..6a319420e7 --- /dev/null +++ b/TUnit.Assertions.Tests/GenerateAssertionArrayTests.cs @@ -0,0 +1,43 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions.Tests; + +/// +/// Tests that [GenerateAssertion] works correctly when targeting concrete array types. +/// The source generator creates an extension method on IAssertionSource<string[]> +/// and ArrayAssertion<string> (returned by Assert.That(string[])) implements that interface. +/// +public class GenerateAssertionArrayTests +{ + [Test] + public async Task ContainsMessage_ExactMatch_Passes() + { + string[] items = ["food", "bard"]; + await Assert.That(items).ContainsMessage("food", true); + } + + [Test] + public async Task ContainsMessage_PartialMatch_Passes() + { + string[] items = ["food", "bard"]; + await Assert.That(items).ContainsMessage("foo", false); + } + + [Test] + public async Task ContainsMessage_NoMatch_Fails() + { + string[] items = ["food", "bard"]; + var action = async () => await Assert.That(items).ContainsMessage("xyz", true); + + await Assert.That(action).Throws(); + } +} + +public static partial class GenerateAssertionArrayTestExtensions +{ + [GenerateAssertion(ExpectationMessage = "to contain message '{needle}'")] + public static bool ContainsMessage(this string[] strings, string needle, bool exact = true) + { + return strings.Any(x => exact ? x == needle : x.Contains(needle)); + } +} From 163af5b2f1f3737f1856a7984f71577103204bec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:08:56 +0000 Subject: [PATCH 4/5] Update PublicAPI snapshots to include ArrayAssertion type Add ArrayAssertion to all 4 framework-specific PublicAPI snapshot files. Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com> --- ...ertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt | 4 ++++ ...sertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt | 4 ++++ ...sertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt | 4 ++++ ....Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt index 59497a2138..7d874bb65d 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt @@ -5600,6 +5600,10 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt index c01ad50b4b..eb7a2f1abe 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt @@ -5548,6 +5548,10 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt index 2a4e6c380f..d44682d167 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt @@ -5600,6 +5600,10 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt index d8f7e630fd..37f6203afc 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt @@ -4886,6 +4886,10 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } From 4756b00166b6cc452d70970a2fc2799d30752ff0 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 16 Feb 2026 23:58:05 +0000 Subject: [PATCH 5/5] fix: update PublicAPI snapshots to match generated assertion class names The source generator's GetSimpleTypeName change for array types produces different class names (e.g., TArray_IsEmpty_Assertion instead of _IsEmpty_Assertion, T_IsIn_TArray_Assertion instead of T_IsIn__Assertion). Co-Authored-By: Claude Opus 4.6 --- ...Has_No_API_Changes.DotNet10_0.verified.txt | 84 +++++++++---------- ..._Has_No_API_Changes.DotNet8_0.verified.txt | 84 +++++++++---------- ..._Has_No_API_Changes.DotNet9_0.verified.txt | 84 +++++++++---------- ...ary_Has_No_API_Changes.Net4_7.verified.txt | 76 ++++++++--------- 4 files changed, 164 insertions(+), 164 deletions(-) diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt index 7d874bb65d..915927dc58 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt @@ -2407,17 +2407,17 @@ namespace .Extensions public static class ArrayAssertionExtensions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsEmpty_Assertion IsEmpty(this . source) { } + public static ._IsEmpty_Assertion IsEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotEmpty_Assertion IsNotEmpty(this . source) { } + public static ._IsNotEmpty_Assertion IsNotEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsNotSingleElement_Assertion IsNotSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } + public static ._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsSingleElement_Assertion IsSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsSingleElement_Assertion IsSingleElement(this . source) { } + public static ._IsSingleElement_Assertion IsSingleElement(this . source) { } } public static class AssemblyAssertionExtensions { @@ -3769,11 +3769,11 @@ namespace .Extensions public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsIn__Assertion IsIn(this . source, params T[] collection) { } + public static .Extensions.T_IsIn_TArray_Assertion IsIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsIn_IEnumerableT_Assertion IsIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsNotIn__Assertion IsNotIn(this . source, params T[] collection) { } + public static .Extensions.T_IsNotIn_TArray_Assertion IsNotIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsNotIn_IEnumerableT_Assertion IsNotIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } } @@ -4855,6 +4855,34 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsEmpty_Assertion : . + { + public TArray_IsEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotEmpty_Assertion : . + { + public TArray_IsNotEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotSingleElement_Assertion : . + { + public TArray_IsNotSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsSingleElement_Assertion : . + { + public TArray_IsSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public sealed class T_IsIn_IEnumerableT_Assertion : . { public T_IsIn_IEnumerableT_Assertion(. context, . collection) { } @@ -4862,9 +4890,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsIn__Assertion : . + public sealed class T_IsIn_TArray_Assertion : . { - public T_IsIn__Assertion(. context, T[] collection) { } + public T_IsIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -4876,9 +4904,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsNotIn__Assertion : . + public sealed class T_IsNotIn_TArray_Assertion : . { - public T_IsNotIn__Assertion(. context, T[] collection) { } + public T_IsNotIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -5526,37 +5554,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsEmpty_Assertion : . - { - public _IsEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotEmpty_Assertion : . - { - public _IsNotEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotSingleElement_Assertion : . - { - public _IsNotSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsSingleElement_Assertion : . - { - public _IsSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } } namespace .Sources { + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncDelegateAssertion : ., ., .<.>, . { public AsyncDelegateAssertion(<.> action, string? expression) { } @@ -5600,10 +5604,6 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } - public class ArrayAssertion : . - { - public ArrayAssertion(TItem[]? value, string? expression) { } - } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt index eb7a2f1abe..14cd180d7a 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt @@ -2386,17 +2386,17 @@ namespace .Extensions public static class ArrayAssertionExtensions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsEmpty_Assertion IsEmpty(this . source) { } + public static ._IsEmpty_Assertion IsEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotEmpty_Assertion IsNotEmpty(this . source) { } + public static ._IsNotEmpty_Assertion IsNotEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsNotSingleElement_Assertion IsNotSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } + public static ._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsSingleElement_Assertion IsSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsSingleElement_Assertion IsSingleElement(this . source) { } + public static ._IsSingleElement_Assertion IsSingleElement(this . source) { } } public static class AssemblyAssertionExtensions { @@ -3735,11 +3735,11 @@ namespace .Extensions public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsIn__Assertion IsIn(this . source, params T[] collection) { } + public static .Extensions.T_IsIn_TArray_Assertion IsIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsIn_IEnumerableT_Assertion IsIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsNotIn__Assertion IsNotIn(this . source, params T[] collection) { } + public static .Extensions.T_IsNotIn_TArray_Assertion IsNotIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsNotIn_IEnumerableT_Assertion IsNotIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } } @@ -4805,6 +4805,34 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsEmpty_Assertion : . + { + public TArray_IsEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotEmpty_Assertion : . + { + public TArray_IsNotEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotSingleElement_Assertion : . + { + public TArray_IsNotSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsSingleElement_Assertion : . + { + public TArray_IsSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public sealed class T_IsIn_IEnumerableT_Assertion : . { public T_IsIn_IEnumerableT_Assertion(. context, . collection) { } @@ -4812,9 +4840,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsIn__Assertion : . + public sealed class T_IsIn_TArray_Assertion : . { - public T_IsIn__Assertion(. context, T[] collection) { } + public T_IsIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -4826,9 +4854,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsNotIn__Assertion : . + public sealed class T_IsNotIn_TArray_Assertion : . { - public T_IsNotIn__Assertion(. context, T[] collection) { } + public T_IsNotIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -5474,37 +5502,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsEmpty_Assertion : . - { - public _IsEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotEmpty_Assertion : . - { - public _IsNotEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotSingleElement_Assertion : . - { - public _IsNotSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsSingleElement_Assertion : . - { - public _IsSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } } namespace .Sources { + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncDelegateAssertion : ., ., .<.>, . { public AsyncDelegateAssertion(<.> action, string? expression) { } @@ -5548,10 +5552,6 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } - public class ArrayAssertion : . - { - public ArrayAssertion(TItem[]? value, string? expression) { } - } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt index d44682d167..ee61d9fb8b 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt @@ -2407,17 +2407,17 @@ namespace .Extensions public static class ArrayAssertionExtensions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsEmpty_Assertion IsEmpty(this . source) { } + public static ._IsEmpty_Assertion IsEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotEmpty_Assertion IsNotEmpty(this . source) { } + public static ._IsNotEmpty_Assertion IsNotEmpty(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsNotSingleElement_Assertion IsNotSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } + public static ._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static ._IsSingleElement_Assertion IsSingleElement(this .<.> source) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions._IsSingleElement_Assertion IsSingleElement(this . source) { } + public static ._IsSingleElement_Assertion IsSingleElement(this . source) { } } public static class AssemblyAssertionExtensions { @@ -3769,11 +3769,11 @@ namespace .Extensions public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsIn__Assertion IsIn(this . source, params T[] collection) { } + public static .Extensions.T_IsIn_TArray_Assertion IsIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsIn_IEnumerableT_Assertion IsIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public static .Extensions.T_IsNotIn__Assertion IsNotIn(this . source, params T[] collection) { } + public static .Extensions.T_IsNotIn_TArray_Assertion IsNotIn(this . source, params T[] collection) { } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public static .Extensions.T_IsNotIn_IEnumerableT_Assertion IsNotIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } } @@ -4855,6 +4855,34 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsEmpty_Assertion : . + { + public TArray_IsEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotEmpty_Assertion : . + { + public TArray_IsNotEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsNotSingleElement_Assertion : . + { + public TArray_IsNotSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] + public sealed class TArray_IsSingleElement_Assertion : . + { + public TArray_IsSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] public sealed class T_IsIn_IEnumerableT_Assertion : . { public T_IsIn_IEnumerableT_Assertion(. context, . collection) { } @@ -4862,9 +4890,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsIn__Assertion : . + public sealed class T_IsIn_TArray_Assertion : . { - public T_IsIn__Assertion(. context, T[] collection) { } + public T_IsIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -4876,9 +4904,9 @@ namespace .Extensions protected override string GetExpectation() { } } [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class T_IsNotIn__Assertion : . + public sealed class T_IsNotIn_TArray_Assertion : . { - public T_IsNotIn__Assertion(. context, T[] collection) { } + public T_IsNotIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -5526,37 +5554,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsEmpty_Assertion : . - { - public _IsEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotEmpty_Assertion : . - { - public _IsNotEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsNotSingleElement_Assertion : . - { - public _IsNotSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] - public sealed class _IsSingleElement_Assertion : . - { - public _IsSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } } namespace .Sources { + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncDelegateAssertion : ., ., .<.>, . { public AsyncDelegateAssertion(<.> action, string? expression) { } @@ -5600,10 +5604,6 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } - public class ArrayAssertion : . - { - public ArrayAssertion(TItem[]? value, string? expression) { } - } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt index 37f6203afc..8fb23d6804 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt @@ -2167,12 +2167,12 @@ namespace .Extensions { public static class ArrayAssertionExtensions { - public static .Extensions._IsEmpty_Assertion IsEmpty(this . source) { } - public static .Extensions._IsNotEmpty_Assertion IsNotEmpty(this . source) { } + public static ._IsEmpty_Assertion IsEmpty(this . source) { } + public static ._IsNotEmpty_Assertion IsNotEmpty(this . source) { } public static ._IsNotSingleElement_Assertion IsNotSingleElement(this .<.> source) { } - public static .Extensions._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } + public static ._IsNotSingleElement_Assertion IsNotSingleElement(this . source) { } public static ._IsSingleElement_Assertion IsSingleElement(this .<.> source) { } - public static .Extensions._IsSingleElement_Assertion IsSingleElement(this . source) { } + public static ._IsSingleElement_Assertion IsSingleElement(this . source) { } } public static class AssemblyAssertionExtensions { @@ -3347,9 +3347,9 @@ namespace .Extensions } public static class GenericAssertions { - public static .Extensions.T_IsIn__Assertion IsIn(this . source, params T[] collection) { } + public static .Extensions.T_IsIn_TArray_Assertion IsIn(this . source, params T[] collection) { } public static .Extensions.T_IsIn_IEnumerableT_Assertion IsIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } - public static .Extensions.T_IsNotIn__Assertion IsNotIn(this . source, params T[] collection) { } + public static .Extensions.T_IsNotIn_TArray_Assertion IsNotIn(this . source, params T[] collection) { } public static .Extensions.T_IsNotIn_IEnumerableT_Assertion IsNotIn(this . source, . collection, [.("collection")] string? collectionExpression = null) { } } public static class GreaterThanAssertionExtensions @@ -4229,15 +4229,39 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class TArray_IsEmpty_Assertion : . + { + public TArray_IsEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class TArray_IsNotEmpty_Assertion : . + { + public TArray_IsNotEmpty_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class TArray_IsNotSingleElement_Assertion : . + { + public TArray_IsNotSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class TArray_IsSingleElement_Assertion : . + { + public TArray_IsSingleElement_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public sealed class T_IsIn_IEnumerableT_Assertion : . { public T_IsIn_IEnumerableT_Assertion(. context, . collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } - public sealed class T_IsIn__Assertion : . + public sealed class T_IsIn_TArray_Assertion : . { - public T_IsIn__Assertion(. context, T[] collection) { } + public T_IsIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -4247,9 +4271,9 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } - public sealed class T_IsNotIn__Assertion : . + public sealed class T_IsNotIn_TArray_Assertion : . { - public T_IsNotIn__Assertion(. context, T[] collection) { } + public T_IsNotIn_TArray_Assertion(. context, T[] collection) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } @@ -4818,33 +4842,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } - public sealed class _IsEmpty_Assertion : . - { - public _IsEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - public sealed class _IsNotEmpty_Assertion : . - { - public _IsNotEmpty_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - public sealed class _IsNotSingleElement_Assertion : . - { - public _IsNotSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } - public sealed class _IsSingleElement_Assertion : . - { - public _IsSingleElement_Assertion(. context) { } - protected override .<.> CheckAsync(. metadata) { } - protected override string GetExpectation() { } - } } namespace .Sources { + public class ArrayAssertion : . + { + public ArrayAssertion(TItem[]? value, string? expression) { } + } public class AsyncDelegateAssertion : ., ., .<.>, . { public AsyncDelegateAssertion(<.> action, string? expression) { } @@ -4886,10 +4890,6 @@ namespace .Sources public .<., TExpected> IsNotTypeOf() { } public .<., TExpected> IsTypeOf() { } } - public class ArrayAssertion : . - { - public ArrayAssertion(TItem[]? value, string? expression) { } - } public class AsyncEnumerableAssertion : . { public AsyncEnumerableAssertion(. value, string? expression) { }