mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[PTRun][Calculator]Update Mages to 2.0.1 (#19087)
* [PTRun][Calculator]Update Mages to 2.0.1 * Fix tests for the new precision
This commit is contained in:
@@ -97,8 +97,6 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
private static IEnumerable<object[]> Interpret_QuirkOutput_WhenCalled_Data =>
|
||||
new[]
|
||||
{
|
||||
new object[] { "0.100000000000000000000", 0.00776627963145224M }, // BUG: Because data structure
|
||||
new object[] { "0.200000000000000000000000", 0.000000400752841041379M }, // BUG: Because data structure
|
||||
new object[] { "123 456", 56088M }, // BUG: Framework accepts ' ' as multiplication
|
||||
};
|
||||
|
||||
@@ -118,6 +116,29 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
Assert.AreEqual(expectedResult, result.Result);
|
||||
}
|
||||
|
||||
private static IEnumerable<object[]> Interpret_GreaterPrecision_WhenCalled_Data =>
|
||||
new[]
|
||||
{
|
||||
new object[] { "0.100000000000000000000", 0.1M },
|
||||
new object[] { "0.200000000000000000000000", 0.2M },
|
||||
};
|
||||
|
||||
[DynamicData(nameof(Interpret_GreaterPrecision_WhenCalled_Data))]
|
||||
[DataTestMethod]
|
||||
public void Interpret_GreaterPrecision_WhenCalled(string input, decimal expectedResult)
|
||||
{
|
||||
// Arrange
|
||||
var engine = new CalculateEngine();
|
||||
|
||||
// Act
|
||||
// Using InvariantCulture since this is internal
|
||||
var result = engine.Interpret(input, CultureInfo.InvariantCulture, out _);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(expectedResult, result.Result);
|
||||
}
|
||||
|
||||
private static IEnumerable<object[]> Interpret_DifferentCulture_WhenCalled_Data =>
|
||||
new[]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user