Ejemplo n.º 1
0
        private void Log10Button_Click(object sender, EventArgs e)
        {
            CalcFinction s = new CalcFinction();

            displayX.Text = Convert.ToString(s.Log10(Convert.ToInt32(displayX.Text)));
            displayY.Clear();
        }
Ejemplo n.º 2
0
        private void SqrtButton_Click(object sender, EventArgs e)
        {
            CalcFinction s = new CalcFinction();

            displayX.Text = Convert.ToString(s.Sqrt(Convert.ToDouble(displayX.Text)));
            displayY.Clear();
        }
Ejemplo n.º 3
0
        public void FactorialTest_x3_expected_6()
        {
            //arrage

            int x = 3;

            int expected = 6;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Factorial(x);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void SqrtTest_forInt_x9_expected_3()
        {
            //arrage

            double x = 9;

            double expected = 3;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Sqrt(x);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 5
0
        public void SubTest_forDouble_x10dot5_y2dot5_expected_8()
        {
            //arrage

            double x = 10.5;
            double y = 2.5;

            double expected = 8;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Sub(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 6
0
        public void SubTest_forINT_x20_y10_expected_10()
        {
            //arrage

            int x = 20;
            int y = 10;

            int expected = 10;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Sub(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 7
0
        public void SumTest_forDouble_xmin12dot5_y2dot5_expected_min10dot5()
        {
            //arrage

            double x = -12.5;
            double y = 2;

            double expected = -10.5;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Summ(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 8
0
        public void ExpTest_forInt_x20_y2_expected_400()
        {
            //arrage

            double x = 20;
            int    y = 2;

            double expected = 400;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Exp(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 9
0
        public void DivTest_forInt_x20dot5_y2_expected_10dot25()
        {
            //arrage

            double x = 20.5;
            double y = 2;

            double expected = 10.25;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Div(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 10
0
        public void MultTest_forDoble_x20dot5_y2_expected_41()
        {
            //arrage

            double x = 20.5;
            double y = 2;

            double expected = 41;

            //act

            CalcFinction s = new CalcFinction();

            double actual = s.Mult(x, y);

            //assert

            Assert.AreEqual(expected, actual);
        }