Skip to content

[PT Run] Sys Plugin Port from Wox.Plugins.Sys #8062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a3d97d5
Initial Port of Wox.Plugin.Sys
Nov 16, 2020
ce16cab
Add Unit Tests for Microsoft.Plugin.Sys
Nov 16, 2020
dc7db62
Modified Microsoft.Plugin.Sys.UnitTests Properties
Nov 16, 2020
dd992d1
Microsoft.Plugin.Sys x64 Launch
Nov 16, 2020
d67e787
Fix Styling for Microsoft.Plugin.Sys.UnitTests
Nov 16, 2020
5aabee4
Fixed Misspelling
Nov 16, 2020
8c91895
Remove Any CPU from Configuration Manager
Nov 17, 2020
63de5c2
Removed Old Icons and Added New Images
Nov 17, 2020
55ce7b2
Updated Titles for Localization and Added & Updated Light/Dark Theme …
Nov 17, 2020
cb340c2
Added Light/Dark Icon Theme Unit Tests
Nov 17, 2020
128187e
Updated QueryTest Expected Results for Microsoft.Plugin.Sys.UnitTests
Nov 17, 2020
6fe1c21
Added Spell-Check Expects for Microsoft.Plugin.Sys
Nov 17, 2020
c2d485a
Updated Spell-Check Expects for Microsoft.Plugin.Sys
benjamhooper Nov 17, 2020
5f698e4
Corrected Format in Microsoft.Plugin.Sys
Nov 18, 2020
45b89d8
Corrected Descriptions and Added Comments for Localization
Nov 18, 2020
6bf5a1c
Added StyleCop and Version Props
Nov 18, 2020
5f20904
Corrected Format of Microsoft.Plugin.Sys.Main
Nov 18, 2020
6d2d7a2
Updated Unit Tests for Microsoft.Plugin.Sys
Nov 18, 2020
6ce7693
Merge branch 'user/benjamhooper/launcher-sys-plugin-port' of https://…
Nov 18, 2020
322b4d5
Updated Spell-Check Expects for Microsoft.Plugin.Sys
Nov 18, 2020
06353e2
Merge branch 'master' into user/benjamhooper/launcher-sys-plugin-port
crutkas Nov 18, 2020
fb8d2e6
fixing build issue
crutkas Nov 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ Elems
ELogo
elseif
Emoji
emptyrecyclebin
ENABLEDPOPUP
endforeach
endif
Expand Down Expand Up @@ -692,6 +693,7 @@ eventdatemissed
eventlog
everytime
evt
EWX
examplehandler
examplepowertoy
EXCLUDEFILES
Expand Down Expand Up @@ -767,6 +769,7 @@ FOFX
FOLDERID
folderpath
fonttbl
FORCEIFHUNG
FORCEOFFLINE
foreach
formatetc
Expand Down Expand Up @@ -1677,6 +1680,7 @@ Portugu
posix
powerappscds
powerlauncher
POWEROFF
powerpreview
powerrename
POWERRENAMETEST
Expand All @@ -1685,6 +1689,7 @@ powertoy
POWERTOYNAME
powertoysinterop
powertoyssetup
Powrprof
ppenum
ppidl
pprm
Expand Down
14 changes: 14 additions & 0 deletions PowerToys.sln
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest-ColorPickerUI", "s
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logging", "src\logging\logging.vcxproj", "{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.Sys", "src\modules\launcher\Plugins\Microsoft.Plugin.Sys\Microsoft.Plugin.Sys.csproj", "{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.Sys.UnitTests", "src\modules\launcher\Plugins\Microsoft.Plugin.Sys.UnitTests\Microsoft.Plugin.Sys.UnitTests.csproj", "{DA5A6FE9-0040-40CC-83CC-764AE5306590}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -549,6 +553,14 @@ Global
{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Debug|x64.Build.0 = Debug|x64
{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Release|x64.ActiveCfg = Release|x64
{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Release|x64.Build.0 = Release|x64
{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B}.Debug|x64.ActiveCfg = Debug|x64
{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B}.Debug|x64.Build.0 = Debug|x64
{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B}.Release|x64.ActiveCfg = Release|x64
{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B}.Release|x64.Build.0 = Release|x64
{DA5A6FE9-0040-40CC-83CC-764AE5306590}.Debug|x64.ActiveCfg = Debug|x64
{DA5A6FE9-0040-40CC-83CC-764AE5306590}.Debug|x64.Build.0 = Debug|x64
{DA5A6FE9-0040-40CC-83CC-764AE5306590}.Release|x64.ActiveCfg = Release|x64
{DA5A6FE9-0040-40CC-83CC-764AE5306590}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -628,6 +640,8 @@ Global
{4FA206A5-F69F-4193-BF8F-F6EEB496734C} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
{090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1} = {1D78B84B-CA39-406C-98F4-71F7EC266CC0}
{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{FD8EB419-FF9C-4D88-BB6F-BF6CED37747B} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
{DA5A6FE9-0040-40CC-83CC-764AE5306590} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Linq;
using System.Text;
using Mono.Collections.Generic;
using Moq;
using NUnit.Framework;
using Wox.Infrastructure;
using Wox.Plugin;

namespace Microsoft.Plugin.Sys.UnitTests
{
public class ImageTests
{
[SetUp]
public void Setup()
{
StringMatcher.Instance = new StringMatcher();
}

[TestCase("shutdown", "Images\\shutdown.dark.png")]
[TestCase("restart", "Images\\restart.dark.png")]
[TestCase("logoff", "Images\\logoff.dark.png")]
[TestCase("lock", "Images\\lock.dark.png")]
[TestCase("sleep", "Images\\sleep.dark.png")]
[TestCase("hibernate", "Images\\sleep.dark.png")]
[TestCase("empty recycle", "Images\\recyclebin.dark.png")]
public void IconThemeDarkTest(string typedString, string expectedResult)
{
// Setup
Mock<Main> main = new Mock<Main>();
main.Object.IconTheme = "dark";
string[] terms = { typedString };
Query expectedQuery = new Query(typedString, typedString, new ReadOnlyCollection<string>(terms), string.Empty);

// Act
var result = main.Object.Query(expectedQuery).FirstOrDefault().IcoPath;

// Assert
Assert.AreEqual(expectedResult, result);
}

[TestCase("shutdown", "Images\\shutdown.light.png")]
[TestCase("restart", "Images\\restart.light.png")]
[TestCase("logoff", "Images\\logoff.light.png")]
[TestCase("lock", "Images\\lock.light.png")]
[TestCase("sleep", "Images\\sleep.light.png")]
[TestCase("hibernate", "Images\\sleep.light.png")]
[TestCase("empty recycle", "Images\\recyclebin.light.png")]
public void IconThemeLightTest(string typedString, string expectedResult)
{
// Setup
Mock<Main> main = new Mock<Main>();
main.Object.IconTheme = "light";
string[] terms = { typedString };
Query expectedQuery = new Query(typedString, typedString, new ReadOnlyCollection<string>(terms), string.Empty);

// Act
var result = main.Object.Query(expectedQuery).FirstOrDefault().IcoPath;

// Assert
Assert.AreEqual(expectedResult, result);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
<Platforms>x64</Platforms>
<RootNamespace>Microsoft.Plugin.Sys.UnitTests</RootNamespace>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.14.7" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Plugin.Sys\Microsoft.Plugin.Sys.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\codeAnalysis\GlobalSuppressions.cs">
<Link>GlobalSuppressions.cs</Link>
</Compile>
<AdditionalFiles Include="..\..\..\..\codeAnalysis\StyleCop.json">
<Link>StyleCop.json</Link>
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<Version>1.1.118</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<Version>3.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Linq;
using Mono.Collections.Generic;
using Moq;
using NUnit.Framework;
using Wox.Infrastructure;
using Wox.Plugin;

namespace Microsoft.Plugin.Sys.UnitTests
{
public class QueryTests
{
[SetUp]
public void Setup()
{
StringMatcher.Instance = new StringMatcher();
}

[TestCase("shutdown", "Shutdown Computer")]
[TestCase("restart", "Restart Computer")]
[TestCase("logoff", "Logoff")]
[TestCase("lock", "Lock Computer")]
[TestCase("sleep", "Put computer to sleep")]
[TestCase("hibernate", "Hibernate")]
[TestCase("empty recycle", "Empty Recycle Bin")]
public void QueryResults(string typedString, string expectedResult)
{
// Setup
Mock<Main> main = new Mock<Main>();
string[] terms = { typedString };
Query expectedQuery = new Query(typedString, typedString, new ReadOnlyCollection<string>(terms), string.Empty);

// Act
var result = main.Object.Query(expectedQuery).FirstOrDefault().SubTitle;

// Assert
Assert.AreEqual(expectedResult, result);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading