mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
rename top level directory search method and tests to reflect intent
This commit is contained in:
parent
4eb2fe9297
commit
7629778610
2 changed files with 8 additions and 8 deletions
|
|
@ -141,13 +141,13 @@ namespace Flow.Launcher.Test.Plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase]
|
[TestCase]
|
||||||
public void GivenWindowsIndexSearch_WhenReturnedZeroResultsAndIsNotIndexed_ThenSearchMethodShouldContinueDirectoryInfoClassSearch()
|
public void GivenTopLevelDirectorySearch_WhenIndexSearchNotRequired_ThenSearchMethodShouldContinueDirectoryInfoClassSearch()
|
||||||
{
|
{
|
||||||
// Given
|
// Given
|
||||||
var searchManager = new SearchManager(new Settings(), new PluginInitContext());
|
var searchManager = new SearchManager(new Settings(), new PluginInitContext());
|
||||||
|
|
||||||
// When
|
// When
|
||||||
var results = searchManager.TopLevelFolderSearchBehaviour(
|
var results = searchManager.TopLevelDirectorySearchBehaviour(
|
||||||
MethodWindowsIndexSearchReturnsZeroResults,
|
MethodWindowsIndexSearchReturnsZeroResults,
|
||||||
MethodDirectoryInfoClassSearchReturnsTwoResults,
|
MethodDirectoryInfoClassSearchReturnsTwoResults,
|
||||||
false,
|
false,
|
||||||
|
|
@ -161,13 +161,13 @@ namespace Flow.Launcher.Test.Plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase]
|
[TestCase]
|
||||||
public void GivenWindowsIndexSearch_WhenReturnedZeroResultsAndIsIndexed_ThenSearchMethodShouldNotContinueDirectoryInfoClassSearch()
|
public void GivenTopLevelDirectorySearch_WhenIndexSearchNotRequired_ThenSearchMethodShouldNotContinueDirectoryInfoClassSearch()
|
||||||
{
|
{
|
||||||
// Given
|
// Given
|
||||||
var searchManager = new SearchManager(new Settings(), new PluginInitContext());
|
var searchManager = new SearchManager(new Settings(), new PluginInitContext());
|
||||||
|
|
||||||
// When
|
// When
|
||||||
var results = searchManager.TopLevelFolderSearchBehaviour(
|
var results = searchManager.TopLevelDirectorySearchBehaviour(
|
||||||
MethodWindowsIndexSearchReturnsZeroResults,
|
MethodWindowsIndexSearchReturnsZeroResults,
|
||||||
MethodDirectoryInfoClassSearchReturnsTwoResults,
|
MethodDirectoryInfoClassSearchReturnsTwoResults,
|
||||||
true,
|
true,
|
||||||
|
|
|
||||||
|
|
@ -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.QuickFolderLinks;
|
||||||
using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex;
|
using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex;
|
||||||
using Flow.Launcher.Plugin.SharedCommands;
|
using Flow.Launcher.Plugin.SharedCommands;
|
||||||
|
|
@ -57,8 +57,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
|
|
||||||
results.Add(ResultManager.CreateOpenCurrentFolderResult(locationPath, indexExists));
|
results.Add(ResultManager.CreateOpenCurrentFolderResult(locationPath, indexExists));
|
||||||
|
|
||||||
results.AddRange(TopLevelFolderSearchBehaviour(WindowsIndexTopLevelFolderSearch,
|
results.AddRange(TopLevelDirectorySearchBehaviour(WindowsIndexTopLevelFolderSearch,
|
||||||
DirectoryInfoClassSearch,
|
DirectoryInfoClassSearch,
|
||||||
indexExists,
|
indexExists,
|
||||||
query,
|
query,
|
||||||
locationPath));
|
locationPath));
|
||||||
|
|
@ -73,7 +73,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
return directoryInfoSearch.TopLevelDirectorySearch(query, querySearch);
|
return directoryInfoSearch.TopLevelDirectorySearch(query, querySearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Result> TopLevelFolderSearchBehaviour(
|
public List<Result> TopLevelDirectorySearchBehaviour(
|
||||||
Func<Query, string, List<Result>> windowsIndexSearch,
|
Func<Query, string, List<Result>> windowsIndexSearch,
|
||||||
Func<Query, string, List<Result>> directoryInfoClassSearch,
|
Func<Query, string, List<Result>> directoryInfoClassSearch,
|
||||||
bool indexExists,
|
bool indexExists,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue