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
[Test]
public void RecordsEqualsMismatch()
{
var a = new Data(1, 1.0);
var b = new Data(1, 1.1);
Assert.That(a, Is.EqualTo(b).Within(0.2), $"{a} != {b}");
}
private sealed record Data(int number, double Value);
But the .Within part is completely ignored. Only the NumericEquals and TupleEquals will use it.
Add a rule warning the user when the .Within constraint is not valid.
Add a CodeFix to remove the constraint.
The text was updated successfully, but these errors were encountered:
@manfred-brands thanks for giving me a hand. I have almost zero experience with Roslyn and stuck a bit on the CodeFix. Most likely it will be very easy for you to advise how can I remove 'Within' node from the syntax tree.
Also, need to add more test cases and documentation
See nunit/nunit#3736
The nunit syntax allows:
But the
.Within
part is completely ignored. Only the NumericEquals and TupleEquals will use it.Add a rule warning the user when the
.Within
constraint is not valid.Add a CodeFix to remove the constraint.
The text was updated successfully, but these errors were encountered: