diff --git a/Flow.Launcher.Test/Plugins/ExplorerTest.cs b/Flow.Launcher.Test/Plugins/ExplorerTest.cs index d662eb6f8..048ed3963 100644 --- a/Flow.Launcher.Test/Plugins/ExplorerTest.cs +++ b/Flow.Launcher.Test/Plugins/ExplorerTest.cs @@ -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}"); + } } }