10using System.Collections.Generic;
19 List<int> toRemove =
new List<int>().FillEach(100, i => i);
20 while (toRemove.Count != 20) {
21 toRemove.RemoveAt(
Random.Range(0, toRemove.Count));
24 doRemoveAtManyTest(toRemove);
29 List<int> toRemove =
new List<int>();
33 doRemoveAtManyTest(toRemove);
38 List<int> toRemove =
new List<int>();
42 doRemoveAtManyTest(toRemove);
47 List<int> toRemove =
new List<int>();
53 doRemoveAtManyTest(toRemove);
58 List<int> toInsert =
new List<int>().FillEach(20, i => i * 1000 + 99);
59 List<int> indexes =
new List<int>().FillEach(100, i => i);
60 while (indexes.Count != toInsert.Count) {
61 indexes.RemoveAt(
Random.Range(0, indexes.Count));
64 doInsertManyTest(toInsert, indexes);
69 List<int> toInsert =
new List<int>();
70 List<int> indexes =
new List<int>();
75 doInsertManyTest(toInsert, indexes);
80 List<int> toInsert =
new List<int>();
81 List<int> indexes =
new List<int>();
86 doInsertManyTest(toInsert, indexes);
91 List<int> toInsert =
new List<int>();
92 List<int> indexes =
new List<int>();
101 doInsertManyTest(toInsert, indexes);
104 private void doRemoveAtManyTest(List<int> toRemove) {
105 List<int> listA =
new List<int>().FillEach(100, i => i);
106 List<int> listB =
new List<int>(listA);
108 for (
int i = toRemove.Count; i-- != 0;) {
109 listA.RemoveAt(toRemove[i]);
112 listB.RemoveAtMany(toRemove);
114 Assert.AreEqual(listA, listB);
117 private void doInsertManyTest(List<int> toInsert, List<int> indexes) {
118 List<int> listA =
new List<int>().FillEach(100, i => i);
119 List<int> listB =
new List<int>(listA);
121 for (
int i = 0; i < toInsert.Count; i++) {
122 listA.Insert(indexes[i], toInsert[i]);
125 listB.InsertMany(indexes, toInsert);
127 Assert.AreEqual(listA, listB);
void RemoveAtMany_Sequential()
void InsertMany_Sequential()
void RemoveAtMany_Random()
void RemoveAtMany_First()