|
From: Mike M. <mik...@gm...> - 2006-03-01 22:19:32
|
On 3/1/06, Joe Ross <joe...@gm...> wrote: > > I'm not involved in the development of NMock2 obviously, but the > question I raise is whether or not everyone's definition of two lists > being equal is the same. My definition for my purpose was that each > list contained the same items in the same order. Someone else might > only care about the same items being in each list but not necessarily > the same order. I realize there is also a SortedList<T> in .NET 2.0, > but I want to use List<T> and add the objects in the correct order > based on business logic Well to me, if I'm using a List I would say I did care about order of items= . If I didn't care, I'd use a Set or a Bag. Problem is neither of those are built-in types for .NET (which is an entirely different rant ;-) ). I was just thinking that "check lists are not null, same size, and each object in turn .Equals() the corresponding object in the other list" is a piece of code most people are gonna end up writing, so maybe we should provide it. Cheers, Mike. |