this is an extension to a previous question I asked, today …. which highlighted the use of CollectionAssert to help test collections (which I never knew).
I have an ICollection<Foo> foos; This has a property called Status, which .. to keep things simple, is an int or byte (whatever floats your boat <– see what I did there?! /me hides).
So, how can I use CollectionAssert to see if all the items, in the returned ICollection, all have the same value for that one property?
I don’t see anything in
CollectionAssertto help, but you could do something like:It’s not ideal in that it won’t show you the actual values in case of failure – but you could write your own method for that, if you need to do this regularly.