Browse Source

Assert the search pane's DataContext before checking the progress binding

ProgressBar.IsIndeterminate defaults to false, so the "nothing is running
yet" assertion would also pass against a pane whose DataContext is not
the resolved SearchPaneModel, and the failure would only surface one
line later, blamed on the binding direction rather than on the missing
DataContext.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/4012/head
Christoph Wille 1 month ago committed by Siegfried Pammer
parent
commit
d5636e318f
  1. 1
      ILSpy.Tests/Search/SearchProgressTests.cs

1
ILSpy.Tests/Search/SearchProgressTests.cs

@ -121,6 +121,7 @@ public class SearchProgressTests
// is an infinite animation, and one that ran while idle would keep the render clock // is an infinite animation, and one that ran while idle would keep the render clock
// busy for as long as the pane exists. // busy for as long as the pane exists.
var search = AppComposition.Current.GetExport<SearchPaneModel>(); var search = AppComposition.Current.GetExport<SearchPaneModel>();
pane.DataContext.Should().BeSameAs(search, "the indicator binds to the pane's own model; anything else makes the assertions below meaningless");
progress!.IsIndeterminate.Should().BeFalse("nothing is running yet"); progress!.IsIndeterminate.Should().BeFalse("nothing is running yet");
search.IsSearching = true; search.IsSearching = true;
Dispatcher.UIThread.RunJobs(); Dispatcher.UIThread.RunJobs();

Loading…
Cancel
Save