-
-
Notifications
You must be signed in to change notification settings - Fork 427
Closed
Description
If you call ShouldBe on two IEnumerable types, ShouldBe should show differences between the two collections.
However if the two IEnumerables are of different runtime types (eg: Array and List) the difference highlighter does not kick in and show what was different between the two IEnumerables even thought it should be perfectly able to do so.
Tests speak louder than rambling...
[Test]
public void ShouldBe_EnumerableTypesOfDifferentRuntimeTypes_ShouldShowDifferences()
{
var a = new Widget { Name = "Joe", Enabled = true };
var b = new Widget { Name = "Joeyjojoshabadoo Jr", Enabled = true };
IEnumerable<Widget> aEnumerable = a.ToEnumerable();
IEnumerable<Widget> bEnumerable = new[] { b };
Should.Error(() =>
aEnumerable.ShouldBe(bEnumerable),
"aEnumerable should be [Name(Joeyjojoshabadoo Jr) Enabled(True)] but was [Name(Joe) Enabled(True)] difference [*Name(Joe) Enabled(True)*]"
);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels