Skip to content

Commit

Permalink
Use live grouping and live filtering in TestExplorer
Browse files Browse the repository at this point in the history
  • Loading branch information
MDoerner committed Jun 7, 2020
1 parent 69bfff3 commit 5ad1e11
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Rubberduck.Core/UI/UnitTesting/TestExplorerViewModel.cs
Expand Up @@ -82,15 +82,18 @@ internal sealed class TestExplorerViewModel : ViewModelBase, INavigateSelection,
AnnotationUpdater = annotationUpdater;

Model = model;
Model.TestCompleted += HandleTestCompletion;

if (CollectionViewSource.GetDefaultView(Model.Tests) is ListCollectionView tests)
{
tests.SortDescriptions.Add(new SortDescription("QualifiedName.QualifiedModuleName.Name", ListSortDirection.Ascending));
tests.SortDescriptions.Add(new SortDescription("QualifiedName.MemberName", ListSortDirection.Ascending));
tests.IsLiveFiltering = true;
tests.IsLiveGrouping = true;
Tests = tests;
}



OnPropertyChanged(nameof(Tests));
TestGrouping = TestExplorerGrouping.Outcome;

Expand Down Expand Up @@ -230,16 +233,6 @@ private bool FilterResults(object unitTest)
return passesNameFilter && passesOutcomeFilter;
}

private void HandleTestCompletion(object sender, TestCompletedEventArgs e)
{
if (TestGrouping != TestExplorerGrouping.Outcome)
{
return;
}

Tests.Refresh();
}

public IRewritingManager RewritingManager { get; }
public IAnnotationUpdater AnnotationUpdater { get; }

Expand Down Expand Up @@ -605,7 +598,6 @@ private void OpenSettings(object param)

public void Dispose()
{
Model.TestCompleted -= HandleTestCompletion;
Model.Dispose();
}
}
Expand Down

0 comments on commit 5ad1e11

Please sign in to comment.