Beispiel #1
0
        public void WrittenValueTestModulus()
        {
            //Set values to test
            string testNumber1 = "one";
            string testNumber2 = "two";

            string result = CalculatorOperations.CalculateAnswer("Modulus", testNumber1, testNumber2);
        }
Beispiel #2
0
        public void MultiplyTest() //requirement 2.1 / 2.2
        {
            //Set values to test
            string testNumber1 = "10";
            string testNumber2 = "4";

            string actualResult   = CalculatorOperations.CalculateAnswer("Multiply", testNumber1, testNumber2);
            string expectedResult = "40";

            Assert.AreEqual(actualResult, expectedResult);
        }
Beispiel #3
0
        public void AdditionTest()
        {
            //Set values to test
            string testNumber1 = "10";
            string testNumber2 = "4";

            string actualResult   = CalculatorOperations.CalculateAnswer("Add", testNumber1, testNumber2);
            string expectedResult = "14";

            Assert.AreEqual(actualResult, expectedResult);
        }
Beispiel #4
0
 private void btnDivide_Click(object sender, EventArgs e)
 {
     txtAnswer.Text = CalculatorOperations.CalculateAnswer("Divide", txtNumber1.Text, txtNumber2.Text);
 }
Beispiel #5
0
 private void btnSubtract_Click(object sender, EventArgs e)
 {
     txtAnswer.Text = CalculatorOperations.CalculateAnswer("Subtract", txtNumber1.Text, txtNumber2.Text);
 }
Beispiel #6
0
 private void btnMultiply_Click(object sender, EventArgs e)
 {
     txtAnswer.Text = CalculatorOperations.CalculateAnswer("Multiply", txtNumber1.Text, txtNumber2.Text);
 }