Description
[Description of the issue]
Complete minimal example reproducing the issue
[Fact]
public void When_a_collection_of_key_value_pairs_is_equivalent_to_the_dictionary_it_should_succeed()
{
// Arrange
var collection = new List<KeyValuePair<string, int>> { new KeyValuePair<string, int>("hi", 1) };
// Act / Assert
Action act = () => collection.Should().BeEquivalentTo(new Dictionary<string, int>()
{
{ "hi", 2 }
});
act.Should().Throw<XunitException>().WithMessage("Expected item[0].Value to be 2, but found 1.*");
}
Expected behavior:
The test passes
Actual behavior:
Expected collection (of type Dictionary<string, int>) to be a System.Collections.Generic.IDictionary`2[System.String,System.Int32],
but found a System.Collections.Generic.List`1[System.Collections.Generic.KeyValuePair`2[System.String,System.Int32]].
Versions
6.0 Beta 1