nunit / nunit.analyzers

Roslyn analyzers for writing unit tests with NUnit
MIT License
86 stars 29 forks source link

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

Open Bartleby2718 opened 1 month ago

Bartleby2718 commented 1 month 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 1 month 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.