Skip to content

Include differences in output for Is.EquivalentTo #1151

@appel1

Description

@appel1

It'd be useful if the output for Is.EquivalentTo included at least one of the differences. Similar to how Is.EqualTo outputs the first index with a difference.

As it is right now you have to debug the test to figure out why the test failed.

        [Test]
        public void DummyTest()
        {
            var expected = Enumerable.Range('a', 12).Select(n => (char)n);
            var actual = expected.Take(11);

            Assert.That(actual, Is.EquivalentTo(expected));
        }
Result StackTrace:  at Dummy.DummyTest() in Dummy.cs:line 20
Result Message: 
Expected: equivalent to < 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'... >
  But was:  < 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'... >

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions