mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Run.Plugin.Calculator] Enable analyzer and fix warnings (#16998)
This commit is contained in:
committed by
GitHub
parent
3e9c7f83c8
commit
79b2cdca7b
@@ -32,7 +32,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
var engine = new CalculateEngine();
|
||||
|
||||
// Act
|
||||
Assert.ThrowsException<ArgumentNullException>(() => engine.Interpret(input));
|
||||
Assert.ThrowsException<ArgumentNullException>(() => engine.Interpret(input, CultureInfo.CurrentCulture));
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
@@ -46,7 +46,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
var engine = new CalculateEngine();
|
||||
|
||||
// Act
|
||||
var result = engine.Interpret(input);
|
||||
var result = engine.Interpret(input, CultureInfo.CurrentCulture);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(default(CalculateResult), result);
|
||||
|
||||
@@ -21,12 +21,10 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||
|
||||
public const int RoundingDigits = 10;
|
||||
|
||||
public CalculateResult Interpret(string input)
|
||||
{
|
||||
// Using CurrentCulture this is user facing
|
||||
return Interpret(input, CultureInfo.CurrentCulture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interpret
|
||||
/// </summary>
|
||||
/// <param name="cultureInfo">Use CultureInfo.CurrentCulture if something is user facing</param>
|
||||
public CalculateResult Interpret(string input, CultureInfo cultureInfo)
|
||||
{
|
||||
if (!CalculateHelper.InputValid(input))
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<Platforms>x64</Platforms>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
||||
Reference in New Issue
Block a user