Example #1
0
 public void CalculateNumbers(string firstNumber, string secondNumber, MathematicalOperation mathematicalOperation)
 {
     SetFirstNumber(firstNumber);
     SetSecondNumber(secondNumber);
     SelectOperation(mathematicalOperation);
     ClickGoButton();
 }
        public void DivisionTest()
        {
            float score;

            score = MathematicalOperation.Division(10, 5);
            Assert.AreEqual(2, score);
        }
        public void MultiplicationTest()
        {
            float score;

            score = MathematicalOperation.Multiplication(10, 5);
            Assert.AreEqual(50, score);
        }
        public void SubtractionTest()
        {
            float score;

            score = MathematicalOperation.Subtraction(10, 5);
            Assert.AreEqual(5, score);
        }
        public void AdditionTest()
        {
            float score;

            score = MathematicalOperation.Addition(10, 5);
            Assert.AreEqual(15, score);
        }
        static double MathOperation(double firstValue, double secondValue, MathematicalOperation operation)
        {
            double result = 0.0;

            if (operation == MathematicalOperation.Add)
            {
                result = firstValue + secondValue;
            }
            else if (operation == MathematicalOperation.Subtract)
            {
                result = firstValue - secondValue;
            }
            else if (operation == MathematicalOperation.Multiply)
            {
                result = firstValue * secondValue;
            }
            else if (operation == MathematicalOperation.Divide)
            {
                result = firstValue / secondValue;
            }

            return(result);
        }
Example #7
0
 private static nint CalculateResult(MathematicalOperation mathematicalOperation, nint numberA, nint numberB) =>
 mathematicalOperation switch
 {
Example #8
0
        private void SelectOperation(MathematicalOperation mathematicalOperation)
        {
            var dropdown = new SelectElement(Driver.FindElement(_operatorDropdown));

            dropdown.SelectByValue(mathematicalOperation.ToString());
        }