|
|
@@ -1216,6 +1216,7 @@ namespace Avalonia.Controls.UnitTests.Selection
|
|
|
var data = (AvaloniaList<string>)target.Source!;
|
|
|
var selectionChangedRaised = 0;
|
|
|
var selectedIndexRaised = 0;
|
|
|
+ var selectedItemRaised = 0;
|
|
|
var indexesChangedRaised = 0;
|
|
|
|
|
|
target.Source = data;
|
|
|
@@ -1227,6 +1228,11 @@ namespace Avalonia.Controls.UnitTests.Selection
|
|
|
{
|
|
|
++selectedIndexRaised;
|
|
|
}
|
|
|
+
|
|
|
+ if (e.PropertyName == nameof(target.SelectedItem))
|
|
|
+ {
|
|
|
+ ++selectedItemRaised;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
target.IndexesChanged += (s, e) => ++indexesChangedRaised;
|
|
|
@@ -1249,6 +1255,7 @@ namespace Avalonia.Controls.UnitTests.Selection
|
|
|
Assert.Equal(2, target.AnchorIndex);
|
|
|
Assert.Equal(1, selectionChangedRaised);
|
|
|
Assert.Equal(1, selectedIndexRaised);
|
|
|
+ Assert.Equal(1, selectedItemRaised);
|
|
|
Assert.Equal(0, indexesChangedRaised);
|
|
|
}
|
|
|
|