Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Commented Issue: Collection.Should().Equal() bug or feature? [11960]

$
0
0
Version 1.7.1

var collection = new[] { "1" };
collection.Should().Equal("1");

Raises an exception:
Expected collection to be equal to "1", but {"1"} differs at index 0.

Thanks.
Comments: ** Comment from web user: dennisdoomen **

This is caused by the fact that the compiler interprets the string as a collection of characters.


Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>