Esempio n. 1
0
        public void BracketWithNoClosingPrimary()
        {
            // SETUP
            var input          = "4/(3+8";
            var expectedResult = new FormatException();
            var calc           = new Calculator_Core();

            calc.SetInput(input);

            // EXECUTE
            calc.Expression();
        }
Esempio n. 2
0
        public void DivisionThenAddition()
        {
            // SETUP
            var    input          = "20/5+25";
            double expectedResult = 4;
            var    calc           = new Calculator_Core();

            calc.SetInput(input);

            // EXECUTE
            var termResult = calc.Term();

            // ASSERT
            Assert.AreEqual(expectedResult, termResult);
        }
Esempio n. 3
0
        public void NumericalPrimary()
        {
            // SETUP
            var    input          = "25";
            double expectedResult = 25;
            var    calc           = new Calculator_Core();

            calc.SetInput(input);

            // EXECUTE
            var numericPrimary = calc.Primary();

            // ASSERT
            Assert.AreEqual(expectedResult, numericPrimary);
        }