public void When_Brackets_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(1 - (5.8 - 12) - 3, parser.Parse("1 - (5.8 - 12) - 3")); Check(2 * (2 + 3) * 4, parser.Parse("2 * ((2 + 3)) * 4")); }
public void When_Conditional_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(1, parser.Parse("1 >= 0 ? 1 : 2")); Check(2, parser.Parse("1 >= 3 ? 1 : 2")); }
public void When_Power_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(Math.Pow(2, Math.Pow(0.5, 3)), parser.Parse("2^0.5^3")); }
public void When_Division_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(4 / 0.4 / 2.8, parser.Parse("4 / 0.4 / 2.8")); }
public void When_Multiplication_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(3 * 1.8 * 0.9, parser.Parse("3 * 1.8 * 0.9")); }
public void When_Subtraction_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(2 - 5.8 - 12, parser.Parse("2 - 5.8 - 12")); }
public void When_Addition_Expect_Reference() { var parser = new ExpressionTreeDerivativeParser(); Check(1 + 2.5 + 10.8, parser.Parse("1 + 2.5 + 10.8")); }