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
public static class ConstraintExtensions {
public static RegexConstraint EqualToANiceName(this ResolvableConstraintExpression expression, string entityType) {
return expression.Matches($@"John");
}
}
class Person { public string Name { get;set; } }
Person p = new();
Assert.That(p, Has.Property(nameof(Person.Name)).EqualToANiceName());
Result:
Error NUnit2024 : The 'RegexConstraint' constraint cannot be used with actual argument of type 'Person' (https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit2024.md)
The text was updated successfully, but these errors were encountered:
Code:
Result:
The text was updated successfully, but these errors were encountered: