示例#1
0
        public void Solve_SquareRoots()
        {
            var equation = "@(64)";
            var expected = "8";

            var actual = Calculator.Solve(equation);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void Solve_Exponants()
        {
            var equation = "3^5";
            var expected = "243";

            var actual = Calculator.Solve(equation);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
 public void Solve_PiGetsConverted()
 {
     Assert.AreEqual("10.2", Calculator.Solve("3.2+7"));
     Assert.AreEqual("9.42477796076938", Calculator.Solve("3*#"));
 }
示例#4
0
 public void Solve_ExceptionOnDivisionByZero()
 => Calculator.Solve("321/(3-3)");
示例#5
0
        public void Solve_DivisionMultiplicationAdditionSubtraction(string equation, string expected)
        {
            var actual = Calculator.Solve(equation);

            Assert.AreEqual(expected, actual);
        }
示例#6
0
        public void Solve_BracketEquations(string equation, string expected)
        {
            var actual = Calculator.Solve(equation);

            Assert.AreEqual(expected, actual);
        }