QueryHelperTests.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using Microsoft.CmdPal.Ext.Calc.Helper;
 6  using Microsoft.VisualStudio.TestTools.UnitTesting;
 7  
 8  namespace Microsoft.CmdPal.Ext.Calc.UnitTests;
 9  
10  [TestClass]
11  public class QueryHelperTests
12  {
13      [DataTestMethod]
14      [DataRow("2²", "4")]
15      [DataRow("2³", "8")]
16      [DataRow("2!", "2")]
17      [DataRow("2\u00A0*\u00A02", "4")] // Non-breaking space
18      [DataRow("20:10", "2")] // Colon as division
19      public void Interpret_HandlesNormalizedInputs(string input, string expected)
20      {
21          var settings = new Settings();
22          var result = QueryHelper.Query(input, settings, false, out _, (_, _) => { });
23  
24          Assert.IsNotNull(result);
25          Assert.AreEqual(expected, result.Title);
26      }
27  }