public void SelectAll(int size) { var collection = new VirtualCollection(size); var selection = new AsyncDataGridRowSelection(collection); int selectionChanged = 0; selection.SelectionChanged += (s, e) => ++ selectionChanged; collection.FocusIndex = 3; selection.SelectAll(); Assert.Equal(R(0, size), selection.GetSnapshot()); Assert.Equal(3, collection.FocusIndex); Assert.Equal(1, selectionChanged); }
public void SelectAll_NonEmpty() { var collection = new VirtualCollection(10); var selection = new AsyncDataGridRowSelection(collection); selection.Select(5); int selectionChanged = 0; selection.SelectionChanged += (s, e) => ++ selectionChanged; selection.SelectAll(); Assert.Equal(R(0, 10), selection.GetSnapshot()); Assert.Equal(5, collection.FocusIndex); Assert.Equal(1, selectionChanged); }