nunit / nunit.analyzers

Roslyn analyzers for writing unit tests with NUnit
MIT License
89 stars 33 forks source link

[suggestion] NUnit2046 doesn't flag Enumerable.SequenceEqual(Enumerable) #750

Open Bartleby2718 opened 5 months ago

Bartleby2718 commented 5 months ago

Very similar to #748, but for .SequenceEqual(). NUnit.Analyzers should be able to convert

var expected = new[] { 1, 2 };
var actual = new[] { 1, 2 };
Assert.That(actual.SequenceEqual(expected));

to

Assert.That(actual, Is.EquivalentTo(expected));

but it doesn't.

Bartleby2718 commented 5 months ago

@manfred-brands Do you think this should be part of NUnit2046 or not?

The corresponding analyzer UseCollectionConstraintAnalyzer.cs has a very generic name, but it just checks for member access operation.