[PT Run] System plugin: Add IP and MAC (#17023)

* first test and changes

* last changes

* last changes

* last changes

* improve exception

* fix spellings

* spell fixes

* search improvements, installer, tests, code cleanup

* remove left-over

* update dev docs

* fix spelling

* update namings

* improve scoring

* spell checker

* dev docs

* update images

* update expect.txt for this pr
This commit is contained in:
Heiko
2022-03-21 13:37:51 +01:00
committed by GitHub
parent 42ba008323
commit 4c067bb728
16 changed files with 1193 additions and 168 deletions

View File

@@ -28,6 +28,9 @@ namespace Microsoft.PowerToys.Run.Plugin.System.UnitTests
[DataRow("hibernate", "Images\\sleep.dark.png")]
[DataRow("empty recycle", "Images\\recyclebin.dark.png")]
[DataRow("uefi firmware settings", "Images\\firmwareSettings.dark.png")]
[DataRow("ip v4 addr", "Images\\networkAdapter.dark.png")]
[DataRow("ip v6 addr", "Images\\networkAdapter.dark.png")]
[DataRow("mac addr", "Images\\networkAdapter.dark.png")]
public void IconThemeDarkTest(string typedString, string expectedResult)
{
// Setup
@@ -52,6 +55,9 @@ namespace Microsoft.PowerToys.Run.Plugin.System.UnitTests
[DataRow("hibernate", "Images\\sleep.light.png")]
[DataRow("empty recycle", "Images\\recyclebin.light.png")]
[DataRow("uefi firmware settings", "Images\\firmwareSettings.light.png")]
[DataRow("ipv4 addr", "Images\\networkAdapter.light.png")]
[DataRow("ipv6 addr", "Images\\networkAdapter.light.png")]
[DataRow("mac addr", "Images\\networkAdapter.light.png")]
public void IconThemeLightTest(string typedString, string expectedResult)
{
// Setup

View File

@@ -2,6 +2,7 @@
// 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;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
@@ -27,6 +28,11 @@ namespace Microsoft.PowerToys.Run.Plugin.System.UnitTests
[DataRow("sleep", "Put computer to sleep")]
[DataRow("hibernate", "Hibernate computer")]
[DataRow("empty recycle", "Empty Recycle Bin")]
[DataRow("ip", "IPv4 address of")]
[DataRow("address", "IPv4 address of")] // searching for address should show ipv4 first
[DataRow("ip v4", "IPv4 address of")]
[DataRow("ip v6", "IPv6 address of")]
[DataRow("mac addr", "MAC address of")]
public void EnvironmentIndependentQueryResults(string typedString, string expectedResult)
{
// Setup
@@ -37,7 +43,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System.UnitTests
var result = main.Object.Query(expectedQuery).FirstOrDefault().SubTitle;
// Assert
Assert.AreEqual(expectedResult, result);
Assert.IsTrue(result.StartsWith(expectedResult, StringComparison.OrdinalIgnoreCase));
}
[TestMethod]