Пример #1
0
        public void DoAll(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 4, $"{value} should be 4");
        }
Пример #2
0
        public void ShouldErrorOnCrap()
        {
            var result = Calc.Calculate(null);

            Assert.IsFalse(result.err.Length == 0, "should not be empty");
        }
Пример #3
0
        public void DoMultiple(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 9, $"{value} should be 9");
        }
Пример #4
0
        public void DoDivide(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 1, $"{value} should be 1");
        }
Пример #5
0
        public void DoErrors(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsFalse(result.err.Length == 0, $"{value} should yield an error");
        }
Пример #6
0
        public void DoPlus(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 6, $"{value} should be 6");
        }
Пример #7
0
        public void DoNotOrder(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 11, $"{value} should be 11");
        }
        public void DoBodmas(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 10, $"{value} should be 10");
        }
        public void DoDivision(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 3, $"{value} should be 3");
        }
Пример #10
0
        public void DoInOrder(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 5, $"{value} should be 5");
        }
Пример #11
0
        public void DoAddMultipy(string value)
        {
            var res = Calc.Calculate(value);

            Assert.IsTrue(res.result == 10, $"{value} should be 10");
        }
Пример #12
0
        public void DoBODMAS(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == -92, $"{value} should be -92");
        }
Пример #13
0
        public void DoMixedExpression(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 8, $"{value} should be 8");
        }
Пример #14
0
        public void PrecedenceOrder(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == -92, $"{value} should be -92");
        }
Пример #15
0
        public void TestPrecedence(string value, double res)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == res, value + " should be " + res);
        }