public void GlobalSetup() { listInt = CreateList(N); listString = listInt.ConvertAll(i => i.ToString()); pooledInt = new PooledList <int>(listInt); pooledString = pooledInt.ConvertAll(i => i.ToString()); }
public void GlobalSetup() { listInt = new List <int>(); for (int i = 0; i < N; i++) { listInt.Add(i); } listString = listInt.ConvertAll(i => i.ToString()); pooledInt = new PooledList <int>(listInt); pooledString = pooledInt.ConvertAll(i => i.ToString()); }
public void GlobalSetup() { listInt = CreateList(N); listString = listInt.ConvertAll(i => i.ToString()); pooledInt = new PooledList <int>(listInt); pooledString = pooledInt.ConvertAll(i => i.ToString()); nonexistentInt = -1; firstInt = 0; middleInt = N / 2; lastInt = N - 1; nonexistentStr = "foo"; firstStr = 0.ToString(); middleStr = (N / 2).ToString(); lastStr = (N - 1).ToString(); }
public void ConvertAll() { var list = new PooledList <int>(new int[] { 1, 2, 3 }); var before = list.ToPooledList(); var after = list.ConvertAll((i) => { return(10 * i); }); Assert.Equal(before.Count, list.Count); Assert.Equal(before.Count, after.Count); for (int i = 0; i < list.Count; i++) { Assert.Equal(before[i], list[i]); Assert.Equal(before[i] * 10, after[i]); } list.Dispose(); before.Dispose(); after.Dispose(); }