From 9bce1a593eda728b688006cce49f9340699189fd Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 28 May 2020 07:38:41 +1000 Subject: [PATCH] Add body for WindowsIndex search all hotkey test --- Flow.Launcher.Test/Plugins/ExplorerTest.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Test/Plugins/ExplorerTest.cs b/Flow.Launcher.Test/Plugins/ExplorerTest.cs index 6007970ba..64d6a91f3 100644 --- a/Flow.Launcher.Test/Plugins/ExplorerTest.cs +++ b/Flow.Launcher.Test/Plugins/ExplorerTest.cs @@ -226,6 +226,22 @@ namespace Flow.Launcher.Test.Plugins $"Actual path string is {previousDirectoryPath} {Environment.NewLine}"); } - public void GivenWindowsIndexSearch_WhenSearchPatternHotKeyIsSearchAll_ThenQueryWhereRestrictionsShouldUseScopeString() { } + [TestCase("c:\\NonExistentFolder\\>", "scope='file:c:\\NonExistentFolder'")] + [TestCase("c:\\NonExistentFolder\\>SomeName", "(System.FileName LIKE 'SomeName%' " + + "OR CONTAINS(System.FileName,'\"SomeName*\"',1033)) AND " + + "scope='file:c:\\NonExistentFolder'")] + public void GivenWindowsIndexSearch_WhenSearchPatternHotKeyIsSearchAll_ThenQueryWhereRestrictionsShouldUseScopeString(string path, string expectedString) + { + // Given + var queryConstructor = new QueryConstructor(new Settings()); + + //When + var resultString = queryConstructor.QueryWhereRestrictionsForTopLevelDirectoryAllFilesAndFoldersSearch(path); + + // Then + Assert.IsTrue(resultString == expectedString, + $"Expected QueryWhereRestrictions string: {expectedString}{Environment.NewLine} " + + $"Actual string was: {resultString}{Environment.NewLine}"); + } } }