From 76297786102900b6618bb430a6a67f6741cd0b2f Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 2 Jun 2020 20:04:22 +1000 Subject: [PATCH] rename top level directory search method and tests to reflect intent --- Flow.Launcher.Test/Plugins/ExplorerTest.cs | 8 ++++---- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher.Test/Plugins/ExplorerTest.cs b/Flow.Launcher.Test/Plugins/ExplorerTest.cs index ca4e96a07..261dfd593 100644 --- a/Flow.Launcher.Test/Plugins/ExplorerTest.cs +++ b/Flow.Launcher.Test/Plugins/ExplorerTest.cs @@ -141,13 +141,13 @@ namespace Flow.Launcher.Test.Plugins } [TestCase] - public void GivenWindowsIndexSearch_WhenReturnedZeroResultsAndIsNotIndexed_ThenSearchMethodShouldContinueDirectoryInfoClassSearch() + public void GivenTopLevelDirectorySearch_WhenIndexSearchNotRequired_ThenSearchMethodShouldContinueDirectoryInfoClassSearch() { // Given var searchManager = new SearchManager(new Settings(), new PluginInitContext()); // When - var results = searchManager.TopLevelFolderSearchBehaviour( + var results = searchManager.TopLevelDirectorySearchBehaviour( MethodWindowsIndexSearchReturnsZeroResults, MethodDirectoryInfoClassSearchReturnsTwoResults, false, @@ -161,13 +161,13 @@ namespace Flow.Launcher.Test.Plugins } [TestCase] - public void GivenWindowsIndexSearch_WhenReturnedZeroResultsAndIsIndexed_ThenSearchMethodShouldNotContinueDirectoryInfoClassSearch() + public void GivenTopLevelDirectorySearch_WhenIndexSearchNotRequired_ThenSearchMethodShouldNotContinueDirectoryInfoClassSearch() { // Given var searchManager = new SearchManager(new Settings(), new PluginInitContext()); // When - var results = searchManager.TopLevelFolderSearchBehaviour( + var results = searchManager.TopLevelDirectorySearchBehaviour( MethodWindowsIndexSearchReturnsZeroResults, MethodDirectoryInfoClassSearchReturnsTwoResults, true, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index f77da2eaa..2a1c7676d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -1,4 +1,4 @@ -using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; +using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; using Flow.Launcher.Plugin.Explorer.Search.QuickFolderLinks; using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex; using Flow.Launcher.Plugin.SharedCommands; @@ -57,8 +57,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search results.Add(ResultManager.CreateOpenCurrentFolderResult(locationPath, indexExists)); - results.AddRange(TopLevelFolderSearchBehaviour(WindowsIndexTopLevelFolderSearch, - DirectoryInfoClassSearch, + results.AddRange(TopLevelDirectorySearchBehaviour(WindowsIndexTopLevelFolderSearch, + DirectoryInfoClassSearch, indexExists, query, locationPath)); @@ -73,7 +73,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return directoryInfoSearch.TopLevelDirectorySearch(query, querySearch); } - public List TopLevelFolderSearchBehaviour( + public List TopLevelDirectorySearchBehaviour( Func> windowsIndexSearch, Func> directoryInfoClassSearch, bool indexExists,