code_junkie

Is the order of an arraylist guaranteed in C#.NET?

Nov 12th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. int size = list.Count;
  2. int index = list.Add(element);
  3. Assert.AreEqual(size, index); // Element is always added at the end
  4. Assert.AreEqual(element, list[index]); // Returned index is position in list
Add Comment
Please, Sign In to add comment