public void TestSortedObservableCollection() { var collection = new SortedObservableCollection<int> { 5, 13, 2, 9, 0, 8, 5, 11, 1, 7, 14, 12, 4, 10, 3, 6 }; collection.Remove(5); for (int i = 0; i < collection.Count; ++i) { Assert.That(collection[i] == i); Assert.That(collection.BinarySearch(i) == i); } Assert.Throws<InvalidOperationException>(() => collection[4] = 10); Assert.Throws<InvalidOperationException>(() => collection.Move(4, 5)); }
public void TestSortedObservableCollection() { var collection = new SortedObservableCollection <int> { 5, 13, 2, 9, 0, 8, 5, 11, 1, 7, 14, 12, 4, 10, 3, 6 }; collection.Remove(5); for (int i = 0; i < collection.Count; ++i) { Assert.That(collection[i] == i); Assert.That(collection.BinarySearch(i) == i); } Assert.Throws <InvalidOperationException>(() => collection[4] = 10); Assert.Throws <InvalidOperationException>(() => collection.Move(4, 5)); }