Open Bartleby2718 opened 1 month ago
It is not a typo, Does.Contain
returns an SomeItemsConstraint
:
/// <summary>
/// Returns a new <see cref="SomeItemsConstraint"/> checking for the
/// presence of a particular object in the collection.
/// </summary>
public static SomeItemsConstraint Contain(object? expected) =>
new(new EqualConstraint(expected));
Unfortunately NUnit has constrain classes and convenience methods to create them and the naming of both might not align.
See the conversation in #749 for context.
Looking at https://github.com/nunit/nunit.analyzers/blob/master/src/nunit.analyzers/Constants/AnalyzerIdentifiers.cs#L57
it does seems like
SomeItemsConstraint
is a typo and therefore should be fixed to something likeCollectionContainsConstraint
in the following places: https://github.com/search?q=repo%3Anunit%2Fnunit.analyzers%20%22Use%20SomeItemsConstraint%20for%20better%20assertion%20messages%20in%20case%20of%20failure%22&type=codeSince this is a minor typo fix, you can likely bundle it with another such issue: #714.