public double Work(string input) { ///костыль, jon skeet не одобряет if (input?.Trim()?.StartsWith("-") ?? false) { input = $"0{input}"; } _validator.ValidateInput(input); var expression = _builder.CreateExpression(input); return(expression.GetValue()); }
public void CreateExpression_EmptyWork_Create() { var result = builder.CreateExpression("1"); Assert.Equal(1.0, result.GetValue()); }