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

* Initial Port of Wox.Plugin.Sys

* Add Unit Tests for Microsoft.Plugin.Sys

* Modified Microsoft.Plugin.Sys.UnitTests Properties

* Microsoft.Plugin.Sys x64 Launch

* Fix Styling for Microsoft.Plugin.Sys.UnitTests

* Fixed Misspelling

* Remove Any CPU from Configuration Manager

* Removed Old Icons and Added New Images

* Updated Titles for Localization and Added & Updated Light/Dark Theme Icons

* Added Light/Dark Icon Theme Unit Tests

* Updated QueryTest Expected Results for Microsoft.Plugin.Sys.UnitTests

* Added Spell-Check Expects for Microsoft.Plugin.Sys

* Updated Spell-Check Expects for Microsoft.Plugin.Sys

* Corrected Format in Microsoft.Plugin.Sys

* Corrected Descriptions and Added Comments for Localization

* Added StyleCop and Version Props

* Corrected Format of Microsoft.Plugin.Sys.Main

* Updated Unit Tests for Microsoft.Plugin.Sys

* Updated Spell-Check Expects for Microsoft.Plugin.Sys

* fixing build issue

Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
Benjamin Hooper
2020-11-26 03:35:48 -06:00
committed by GitHub
parent 3bd18af816
commit 9757a4574f
24 changed files with 949 additions and 0 deletions

View File

@@ -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("sign out", "Sign out of computer")]
[TestCase("lock", "Lock computer")]
[TestCase("sleep", "Put computer to sleep")]
[TestCase("hibernate", "Hibernate computer")]
[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);
}
}
}