mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add test for DirectoryInfoSearch search criteria
This commit is contained in:
parent
64986b609f
commit
a478e20352
1 changed files with 18 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.Plugin.Explorer;
|
||||
using Flow.Launcher.Plugin.Explorer.Search;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
using NUnit.Framework;
|
||||
|
|
@ -243,5 +244,22 @@ namespace Flow.Launcher.Test.Plugins
|
|||
$"Expected QueryWhereRestrictions string: {expectedString}{Environment.NewLine} " +
|
||||
$"Actual string was: {resultString}{Environment.NewLine}");
|
||||
}
|
||||
|
||||
[TestCase("c:\\somefolder\\>somefile","*somefile*")]
|
||||
[TestCase("c:\\somefolder\\somefile", "somefile*")]
|
||||
[TestCase("c:\\somefolder\\", "*")]
|
||||
public void GivenDirectoryInfoSearch_WhenSearchPatternHotKeyIsSearchAll_ThenSearchCriteriaShouldUseCriteriaString(string path, string expectedString)
|
||||
{
|
||||
// Given
|
||||
var criteriaConstructor = new DirectoryInfoSearch(new Settings());
|
||||
|
||||
//When
|
||||
var resultString = criteriaConstructor.ConstructSearchCriteria(path);
|
||||
|
||||
// Then
|
||||
Assert.IsTrue(resultString == expectedString,
|
||||
$"Expected criteria string: {expectedString}{Environment.NewLine} " +
|
||||
$"Actual criteria string was: {resultString}{Environment.NewLine}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue