I\'ve got a pair of Lists I\'m trying to compare using Fluent Assertions. I can code up a comparison easily, but I\'d like to use Fluent Assertions so that I can get the rea
you could wirte a extension method for IEnumerable
yourself (this is how I do this stuff) and I thing some Unit-Testframeworks already do so (FSUnit AFAIK)
Here is a simple example (you could improve a lot - but it should do)
public static AssertEqualSetCaseInsensitive(this IEnumerable actual, IEnumerable expected)
{
if (actual.Count() != expected.Count())
Assert.Fail("not same number of elements");
if (!actual.All(a => expected.Any(e => e.ToLower() == a.ToLower()))
Assert.Fail("not same sets");
}
just use like
actual.AssertEqualSetCaseInsensitive(expected);