The analysis rule FAA0001: Use .Should().OnlyHaveUniqueItems() is triggered for collections that are not actually the same:
// Arrange
var expected = new List<string> {"First"};
// Act
var actual = new List<int> {0};
// Assert
actual.Should().HaveSameCount(expected.Distinct());
Expected behavior:
This code should not trigger the rule about using .OnlyHaveUniqueItems(), since it has a different meaning (consider that expected is passed in, instead of actual).
Description
The analysis rule FAA0001: Use
.Should().OnlyHaveUniqueItems()
is triggered for collections that are not actually the same:Expected behavior:
This code should not trigger the rule about using
.OnlyHaveUniqueItems()
, since it has a different meaning (consider thatexpected
is passed in, instead ofactual
).Actual behavior:
The rule is triggered.
Versions