public void AddRange(EnumerableType enumerableType, int listLength, int enumerableLength, int numberOfMatchingElements, int numberOfDuplicateElements) { List <T> list = GenericListFactory(listLength); List <T> listBeforeAdd = list.ToList(); SCG.IEnumerable <T> enumerable = CreateEnumerable(enumerableType, list, enumerableLength, numberOfMatchingElements, numberOfDuplicateElements); list.AddRange(enumerable); // Check that the first section of the List is unchanged Assert.All(Enumerable.Range(0, listLength), index => { Assert.Equal(listBeforeAdd[index], list[index]); }); // Check that the added elements are correct Assert.All(Enumerable.Range(0, enumerableLength), index => { Assert.Equal(enumerable.ElementAt(index), list[index + listLength]); }); }