diff --git a/src/modules/launcher/Wox.Test/Plugins/WindowsIndexerTest.cs b/src/modules/launcher/Wox.Test/Plugins/WindowsIndexerTest.cs index fe04c8b9dd..b6375a89bc 100644 --- a/src/modules/launcher/Wox.Test/Plugins/WindowsIndexerTest.cs +++ b/src/modules/launcher/Wox.Test/Plugins/WindowsIndexerTest.cs @@ -49,7 +49,7 @@ namespace Wox.Test.Plugins string pattern = "*"; WindowsSearchAPI api = GetWindowsSearchAPI(); WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles); - + // Act WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern); @@ -201,12 +201,12 @@ namespace Wox.Test.Plugins public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue() { ISearchQueryHelper queryHelper; - String pattern = "notepad"; - WindowsSearchAPI _api = GetWindowsSearchAPI(); - _api.DisplayHiddenFiles = true; + string pattern = "notepad"; + WindowsSearchAPI api = GetWindowsSearchAPI(); + api.DisplayHiddenFiles = true; // Act - WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles); + WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles); WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern); // Assert @@ -217,32 +217,31 @@ namespace Wox.Test.Plugins public void WindowsSearchAPI_ShouldRequestFilteredRequest_WhenDisplayHiddenFilesIsFalse() { ISearchQueryHelper queryHelper; - String pattern = "notepad"; - WindowsSearchAPI _api = GetWindowsSearchAPI(); - _api.DisplayHiddenFiles = false; + string pattern = "notepad"; + WindowsSearchAPI api = GetWindowsSearchAPI(); + api.DisplayHiddenFiles = false; // Act - WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles); + WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles); WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern); // Assert Assert.IsTrue(queryHelper.QueryWhereRestrictions.Contains("AND System.FileAttributes <> SOME BITWISE 2")); } - [Test] public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue_AfterRuntimeSwap() { ISearchQueryHelper queryHelper; - String pattern = "notepad"; - WindowsSearchAPI _api = GetWindowsSearchAPI(); - _api.DisplayHiddenFiles = false; + string pattern = "notepad"; + WindowsSearchAPI api = GetWindowsSearchAPI(); + api.DisplayHiddenFiles = false; // Act - WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles); + WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles); WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern); - _api.DisplayHiddenFiles = true; - WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles); + api.DisplayHiddenFiles = true; + WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles); WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern); // Assert @@ -416,10 +415,10 @@ namespace Wox.Test.Plugins List results = new List() { file1, file2 }; var mock = new Mock(); mock.Setup(x => x.Query(It.IsAny(), It.IsAny())).Returns(results); - WindowsSearchAPI _api = new WindowsSearchAPI(mock.Object, false); + WindowsSearchAPI api = new WindowsSearchAPI(mock.Object, false); // Act - var windowsSearchAPIResults = _api.Search("file", true); + var windowsSearchAPIResults = api.Search("file", true); // Assert Assert.IsTrue(windowsSearchAPIResults.Count() == 0); diff --git a/src/modules/launcher/Wox.Test/Wox.Test.csproj b/src/modules/launcher/Wox.Test/Wox.Test.csproj index b8338e78af..1403607efc 100644 --- a/src/modules/launcher/Wox.Test/Wox.Test.csproj +++ b/src/modules/launcher/Wox.Test/Wox.Test.csproj @@ -39,7 +39,13 @@ MinimumRecommendedRules.ruleset 4 - + + true + + + + true +