public void TryParseFromExpression_IncorrectScenario() { foreach (var expression in BadExpressions) { double result; Assert.IsFalse(NumericValueParser.TryParseFromExpression(expression, out result), $"incorrect result : {result} | parse mistakenly passed on \"{expression.ToFullString()}\""); } }
public void TryParseFromExpression_NormalScenario() { foreach (var sample in GoodSamples) { double result; Assert.IsTrue(NumericValueParser.TryParseFromExpression(sample.Expression, out result), $"parse error on \"{sample.Expression.ToFullString()}\""); Assert.AreEqual(result, sample.Correct, $"expected {sample.Correct} but {result} | on \"{sample.Expression.ToFullString()}\""); } }