mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[Analyzers] Update StyleCop and enable SA1200 (#22707)
* update StyleCop and enable SA1200 * Fix merge issues * fix build and added using rule
This commit is contained in:
committed by
GitHub
parent
617150cf50
commit
6d138e80fb
@@ -63,9 +63,9 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void IconThemeDarkTest(string typedString, string subTitleMatch, string expectedResult)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Mock<Main> main = new();
|
||||
main.Object.IconTheme = "dark";
|
||||
Query expectedQuery = new ("(" + typedString, "(");
|
||||
Query expectedQuery = new("(" + typedString, "(");
|
||||
|
||||
// Act
|
||||
string result = main.Object.Query(expectedQuery).FirstOrDefault(predicate: x => x.SubTitle.StartsWith(subTitleMatch, System.StringComparison.CurrentCulture)).IcoPath;
|
||||
@@ -108,9 +108,9 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void IconThemeLightTest(string typedString, string subTitleMatch, string expectedResult)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Mock<Main> main = new();
|
||||
main.Object.IconTheme = "light";
|
||||
Query expectedQuery = new ("(" + typedString, "(");
|
||||
Query expectedQuery = new("(" + typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault(x => x.SubTitle.StartsWith(subTitleMatch, System.StringComparison.CurrentCulture)).IcoPath;
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void CountWithoutPluginKeyword(string typedString, int expectedResultCount)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString);
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString);
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).Count;
|
||||
@@ -63,8 +63,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void CountWithPluginKeyword(string typedString, int expectedResultCount)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery);
|
||||
@@ -87,8 +87,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void ValidateBehaviorOnGlobalQueries(string typedString, int expectedResultCount)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString);
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString);
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery);
|
||||
@@ -141,8 +141,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void CanFindFormatResult(string typedString, string expectedResult)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault(x => x.SubTitle.StartsWith(expectedResult, StringComparison.CurrentCulture));
|
||||
@@ -160,8 +160,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void DateTimeNumberOnlyInput(string typedString, string expectedResult)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault(x => x.SubTitle.StartsWith(expectedResult, StringComparison.CurrentCulture));
|
||||
@@ -188,8 +188,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void InvalidInputNotShowsResults(string typedString)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault();
|
||||
@@ -206,8 +206,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void InvalidNumberInputShowsErrorMessage(string typedString)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault().Title;
|
||||
@@ -224,8 +224,8 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests
|
||||
public void InvalidInputNotShowsErrorMessage(string typedString)
|
||||
{
|
||||
// Setup
|
||||
Mock<Main> main = new ();
|
||||
Query expectedQuery = new (typedString, "(");
|
||||
Mock<Main> main = new();
|
||||
Query expectedQuery = new(typedString, "(");
|
||||
|
||||
// Act
|
||||
var result = main.Object.Query(expectedQuery).FirstOrDefault();
|
||||
|
||||
Reference in New Issue
Block a user