nunit/nunit.analyzers

Fix the typo in the title for NUnit2014

Bartleby2718 opened this issue · 1 comments

See the conversation in #749 for context.

Looking at https://github.com/nunit/nunit.analyzers/blob/master/src/nunit.analyzers/Constants/AnalyzerIdentifiers.cs#L57

        internal const string CollectionContainsConstraintUsage = "NUnit2014";

it does seems like SomeItemsConstraint is a typo and therefore should be fixed to something like CollectionContainsConstraint 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=code

Since this is a minor typo fix, you can likely bundle it with another such issue: #714.

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.