Skip to content

Commit 5ad1e11

Browse files
committed
Use live grouping and live filtering in TestExplorer
1 parent 69bfff3 commit 5ad1e11

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Rubberduck.Core/UI/UnitTesting/TestExplorerViewModel.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,18 @@ public TestExplorerViewModel(ISelectionService selectionService,
8282
AnnotationUpdater = annotationUpdater;
8383

8484
Model = model;
85-
Model.TestCompleted += HandleTestCompletion;
8685

8786
if (CollectionViewSource.GetDefaultView(Model.Tests) is ListCollectionView tests)
8887
{
8988
tests.SortDescriptions.Add(new SortDescription("QualifiedName.QualifiedModuleName.Name", ListSortDirection.Ascending));
9089
tests.SortDescriptions.Add(new SortDescription("QualifiedName.MemberName", ListSortDirection.Ascending));
90+
tests.IsLiveFiltering = true;
91+
tests.IsLiveGrouping = true;
9192
Tests = tests;
9293
}
9394

95+
96+
9497
OnPropertyChanged(nameof(Tests));
9598
TestGrouping = TestExplorerGrouping.Outcome;
9699

@@ -230,16 +233,6 @@ private bool FilterResults(object unitTest)
230233
return passesNameFilter && passesOutcomeFilter;
231234
}
232235

233-
private void HandleTestCompletion(object sender, TestCompletedEventArgs e)
234-
{
235-
if (TestGrouping != TestExplorerGrouping.Outcome)
236-
{
237-
return;
238-
}
239-
240-
Tests.Refresh();
241-
}
242-
243236
public IRewritingManager RewritingManager { get; }
244237
public IAnnotationUpdater AnnotationUpdater { get; }
245238

@@ -605,7 +598,6 @@ private void OpenSettings(object param)
605598

606599
public void Dispose()
607600
{
608-
Model.TestCompleted -= HandleTestCompletion;
609601
Model.Dispose();
610602
}
611603
}

0 commit comments

Comments
 (0)