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

New Post: new[] { "ab" }.Should().Equal("ab") fails

$
0
0

Hi!

This fails:

   new[] { "ab" }.Should().Equal("ab");

this is OK:

    new[] { "ab" }.Should().Equal(new[] { "ab" });

This happens because Equal has overload that takes IEnumerable and string is treated as a sequence of characters.

It should be possible to make Equal generic (same was as assertion methods in xUnit.Net)

    void Equal<T>(params T[] values);

    void Equal<T>(IEnumerable<T> values);


Viewing all articles
Browse latest Browse all 1402

Trending Articles



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