mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 18:29:24 +08:00
Enabling warnings as errors and correcting StyleCop issues (#6007)
This commit is contained in:
parent
315caaba1c
commit
9d46fae865
@ -201,12 +201,12 @@ namespace Wox.Test.Plugins
|
|||||||
public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue()
|
public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue()
|
||||||
{
|
{
|
||||||
ISearchQueryHelper queryHelper;
|
ISearchQueryHelper queryHelper;
|
||||||
String pattern = "notepad";
|
string pattern = "notepad";
|
||||||
WindowsSearchAPI _api = GetWindowsSearchAPI();
|
WindowsSearchAPI api = GetWindowsSearchAPI();
|
||||||
_api.DisplayHiddenFiles = true;
|
api.DisplayHiddenFiles = true;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles);
|
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles);
|
||||||
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
@ -217,32 +217,31 @@ namespace Wox.Test.Plugins
|
|||||||
public void WindowsSearchAPI_ShouldRequestFilteredRequest_WhenDisplayHiddenFilesIsFalse()
|
public void WindowsSearchAPI_ShouldRequestFilteredRequest_WhenDisplayHiddenFilesIsFalse()
|
||||||
{
|
{
|
||||||
ISearchQueryHelper queryHelper;
|
ISearchQueryHelper queryHelper;
|
||||||
String pattern = "notepad";
|
string pattern = "notepad";
|
||||||
WindowsSearchAPI _api = GetWindowsSearchAPI();
|
WindowsSearchAPI api = GetWindowsSearchAPI();
|
||||||
_api.DisplayHiddenFiles = false;
|
api.DisplayHiddenFiles = false;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles);
|
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles);
|
||||||
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsTrue(queryHelper.QueryWhereRestrictions.Contains("AND System.FileAttributes <> SOME BITWISE 2"));
|
Assert.IsTrue(queryHelper.QueryWhereRestrictions.Contains("AND System.FileAttributes <> SOME BITWISE 2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue_AfterRuntimeSwap()
|
public void WindowsSearchAPI_ShouldRequestNormalRequest_WhenDisplayHiddenFilesIsTrue_AfterRuntimeSwap()
|
||||||
{
|
{
|
||||||
ISearchQueryHelper queryHelper;
|
ISearchQueryHelper queryHelper;
|
||||||
String pattern = "notepad";
|
string pattern = "notepad";
|
||||||
WindowsSearchAPI _api = GetWindowsSearchAPI();
|
WindowsSearchAPI api = GetWindowsSearchAPI();
|
||||||
_api.DisplayHiddenFiles = false;
|
api.DisplayHiddenFiles = false;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles);
|
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles);
|
||||||
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
||||||
_api.DisplayHiddenFiles = true;
|
api.DisplayHiddenFiles = true;
|
||||||
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, _api.DisplayHiddenFiles);
|
WindowsSearchAPI.InitQueryHelper(out queryHelper, 10, api.DisplayHiddenFiles);
|
||||||
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
WindowsSearchAPI.ModifyQueryHelper(ref queryHelper, pattern);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
@ -416,10 +415,10 @@ namespace Wox.Test.Plugins
|
|||||||
List<OleDBResult> results = new List<OleDBResult>() { file1, file2 };
|
List<OleDBResult> results = new List<OleDBResult>() { file1, file2 };
|
||||||
var mock = new Mock<ISearch>();
|
var mock = new Mock<ISearch>();
|
||||||
mock.Setup(x => x.Query(It.IsAny<string>(), It.IsAny<string>())).Returns(results);
|
mock.Setup(x => x.Query(It.IsAny<string>(), It.IsAny<string>())).Returns(results);
|
||||||
WindowsSearchAPI _api = new WindowsSearchAPI(mock.Object, false);
|
WindowsSearchAPI api = new WindowsSearchAPI(mock.Object, false);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var windowsSearchAPIResults = _api.Search("file", true);
|
var windowsSearchAPIResults = api.Search("file", true);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsTrue(windowsSearchAPIResults.Count() == 0);
|
Assert.IsTrue(windowsSearchAPIResults.Count() == 0);
|
||||||
|
@ -39,7 +39,13 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.csproj" />
|
<ProjectReference Include="..\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.csproj" />
|
||||||
<ProjectReference Include="..\Plugins\Microsoft.Plugin.Indexer\Microsoft.Plugin.Indexer.csproj" />
|
<ProjectReference Include="..\Plugins\Microsoft.Plugin.Indexer\Microsoft.Plugin.Indexer.csproj" />
|
||||||
|
Loading…
Reference in New Issue
Block a user