Assertions on each member of a sequence

Apr 21, 2010 at 10:23 AM


Thanks for writing and publishing this. I'm just in the process of moving from my home-grown fluent assertions framework to #TestsEx, however I have a useful helper method which doesn't seem to be here.

I would like to able to make some assertion on every member of a sequence (IEnumerable<T>) - it might look like so in your framework:


Is this technically possible?


Apr 21, 2010 at 9:29 PM

sequence.All(x=> x.Satisfy(a=> a != null));

Apr 21, 2010 at 10:40 PM

Ahah, I hadn't noticed that Satisfy returns bool. Thanks!