Say we have a class
class A
{
int num;
string str;
// more methods and data members
}
In a nunit test, how can we do something in the lines of
List<A> listA = GetUniqueValueList();
CollectionAssert.AllItemsAreUnique(listA, "ListA items should be unique.");
As far as I understand, the AllItemsAreUniqe works for lists with value types only. Also this test doesn't fail if say two A objects have exact same members.