Skip to content

CollectionAssert.AreEqual message include only inmost collection's index on nested collection #7363

@JardinHotel

Description

@JardinHotel

Describe the bug

CollectionAssert.AreEqual on nested collection shows message include inmost collection's index only.
It doesn't help to find out mismatch item in test case not so much.

Version used

MSTest v4.1.0

Steps To Reproduce

Repro Project

  1. Create Test Project
  2. Add TestMethod assert nested collection
  3. Run Test
CollectionAssert.AreEqual(new[] { "1", "2222", "3" }, new[] { "1", "2225", "3" });

Expected behavior

The message include all indexes.

CollectionAssert.AreEqual failed. Element at index [1, 3] do not match.
Expected: 2
Actual: 5

Actual behavior

The message include only inmost collection's index.

CollectionAssert.AreEqual failed. Element at index 3 do not match.
Expected: 2
Actual: 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions