You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using a helper like the one below, and we get an NUnit2050 error (NUnit 4 no longer supports string.Format specification for Assert)
As you see we are just setting some predefined timeout&retry interval on Assert.That
Wonder if the analyzer could be enhanced to not treat such cases as a violation on NUnit2050.
public static Desk AssertThat<TWindow>(
this Desk desk,
Func<TWindow, object> valueProvider,
IConstraint expression,
NUnitString message = default,
[CallerArgumentExpression(nameof(valueProvider))] string actualExpression = "",
[CallerArgumentExpression(nameof(expression))] string constraintExpression = ""
) where TWindow : DeskWindow
{
var window = desk.Capture<TWindow>();
Assert.That(
(ActualValueDelegate<object>)(() => valueProvider.Invoke(window)),
new DelayedConstraint(expression, 3000, 300,
message, actualExpression, constraintExpression);
return desk;
}
@dfev77 I can reproduce the error and updated the rule to allow this when the argument is in fact a parameter with a CallerArgumentExpression attribute.
Activity
manfred-brands commentedon Jul 29, 2025
@dfev77 I can reproduce the error and updated the rule to allow this when the argument is in fact a parameter with a CallerArgumentExpression attribute.