using Knoks.Framework.Extentions;
using Xunit;

namespace Knoks.Test.Units.Framework
{
    public class ExtensionsTest
    {

        [Theory(DisplayName = "EvaluateExpression_ValidInputs_Equal")]
        [InlineData("(pow(2,2))", 4)]
        [InlineData("(sqrt(4))", 2)]
        [InlineData("(3+5*4)", 23)]
        [InlineData("(pow(sqrt(1*0.2+1*0.3+0.5*((1*0.5+1*0.5))),2))", 1)]
        void EvaluateExpression_ValidInputs_Equal(string expression, double expectedResult)
        {
            var res = expression.EvaluateExpression();
            Assert.Equal(expectedResult, res);
        }
    }
}
