-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce interpolated string handler overloads for assertions #4476
base: main
Are you sure you want to change the base?
Introduce interpolated string handler overloads for assertions #4476
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please apply the various suggestions on AreEqual
globally?
Thanks for the review @Evangelink. Those comments were really very helpful and revealed some important issues. |
|
||
public void AppendLiteral(string value) => _builder!.Append(value); | ||
|
||
public void AppendFormatted<T>(T value) => AppendFormatted(value, format: null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should be adding AppendFormatted(string?)
overload. This should be resolved before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work. I didn't review every single test added but I assume you have used the same pattern everywhere so LGTM
@@ -80,6 +432,12 @@ public static void AreEqual<T>(T? expected, T? actual, IEqualityComparer<T>? com | |||
public static void AreEqual<T>(T? expected, T? actual, string? message) | |||
=> AreEqual(expected, actual, null, message, null); | |||
|
|||
/// <inheritdoc cref="AreEqual{T}(IEquatable{T}?, IEquatable{T}?, string?)" /> | |||
#pragma warning disable IDE0060 // Remove unused parameter - https://github.com/dotnet/roslyn/issues/76578 | |||
public static void AreEqual<T>(T? expected, T? actual, [InterpolatedStringHandlerArgument(nameof(expected), nameof(actual))] ref AssertAreEqualInterpolatedStringHandler<T> message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if runtime calls this parameter message
, I would prefer handler
or builder
like in the example.
Fixes #4273