diff --git a/TUnit.Assertions/Extensions/AssertionExtensions.cs b/TUnit.Assertions/Extensions/AssertionExtensions.cs index d065942ad1..95aee50a34 100644 --- a/TUnit.Assertions/Extensions/AssertionExtensions.cs +++ b/TUnit.Assertions/Extensions/AssertionExtensions.cs @@ -262,7 +262,7 @@ public static MemberAssertionResult Member( /// Example: await Assert.That(myObject).Member(x => x.Attributes, attrs => attrs.ContainsKey("status").And.IsNotEmpty()); /// Note: This overload exists for backward compatibility. For AOT compatibility, use the TTransformed overload instead. /// - [OverloadResolutionPriority(2)] + [OverloadResolutionPriority(1)] [RequiresDynamicCode("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] public static MemberAssertionResult Member( this IAssertionSource source, @@ -421,7 +421,7 @@ public static MemberAssertionResult Member( /// Example: await Assert.That(myObject).Member(x => x.Tags, tags => tags.HasCount(1).And.Contains("value")); /// Note: This overload exists for backward compatibility. For AOT compatibility, use the TTransformed overload instead. /// - [OverloadResolutionPriority(1)] + [OverloadResolutionPriority(0)] [RequiresDynamicCode("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] public static MemberAssertionResult Member( this IAssertionSource source, @@ -527,6 +527,7 @@ public static MemberAssertionResult Member x.PropertyName, value => value.IsEqualTo(expectedValue)); /// + [OverloadResolutionPriority(0)] public static MemberAssertionResult Member( this IAssertionSource source, Expression> memberSelector, @@ -579,6 +580,7 @@ public static MemberAssertionResult Member( /// Example: await Assert.That(myObject).Member(x => x.PropertyName, value => value.IsEqualTo(expectedValue)); /// Note: This overload exists for backward compatibility. For AOT compatibility, use the TTransformed overload instead. /// + [OverloadResolutionPriority(-1)] [RequiresDynamicCode("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] public static MemberAssertionResult Member( this IAssertionSource source, 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 e1e5f6bbf0..e67b9f26b0 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 @@ -1649,11 +1649,13 @@ namespace .Extensions public static . Member(this . source, .<>> memberSelector, <.<., TItem>, .<.>> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] - [.(1)] + [.(0)] public static . Member(this . source, .<>> memberSelector, <.<., TItem>, object> assertions) { } + [.(0)] public static . Member(this . source, .<> memberSelector, <., .> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] + [.(-1)] public static . Member(this . source, .<> memberSelector, <., object> assertions) { } [.(2)] public static . Member(this . source, .<>> memberSelector, <.<., TItem>, .> assertions) { } @@ -1661,7 +1663,7 @@ namespace .Extensions public static . Member(this . source, .<>> memberSelector, <.<., TKey, TValue>, .<.>> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] - [.(2)] + [.(1)] public static . Member(this . source, .<>> memberSelector, <.<., TKey, TValue>, object> assertions) { } [.(1)] public static . Member(this . source, .<> memberSelector, <., .> assertions) { } 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 a6c9c27621..9a12c7e10b 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 @@ -1649,11 +1649,13 @@ namespace .Extensions public static . Member(this . source, .<>> memberSelector, <.<., TItem>, .<.>> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] - [.(1)] + [.(0)] public static . Member(this . source, .<>> memberSelector, <.<., TItem>, object> assertions) { } + [.(0)] public static . Member(this . source, .<> memberSelector, <., .> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] + [.(-1)] public static . Member(this . source, .<> memberSelector, <., object> assertions) { } [.(2)] public static . Member(this . source, .<>> memberSelector, <.<., TItem>, .> assertions) { } @@ -1661,7 +1663,7 @@ namespace .Extensions public static . Member(this . source, .<>> memberSelector, <.<., TKey, TValue>, .<.>> assertions) { } [.("Uses reflection for legacy compatibility. For AOT compatibility, use the Member overload with strongly-typed assertions.")] - [.(2)] + [.(1)] public static . Member(this . source, .<>> memberSelector, <.<., TKey, TValue>, object> assertions) { } [.(1)] public static . Member(this . source, .<> memberSelector, <., .> assertions) { }