Example #1
0
        // Tests of factorial
        // Created by Yahor Senichak
        public void FactorialTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();


            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("...")); //хз работает так или нет
            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_5_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("120"));

            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("3628800"));

            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_0_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("1"));

            testedForm.button_delete_Click(testedForm, e);

            /*
             * testedForm.button_factorial_Click(testedForm, e);
             * testedForm.button_minus_Click(testedForm, e);
             * testedForm.button_10_Click(testedForm, e);
             * testedForm.button_equal_Click(testedForm, e);
             * Assert.IsTrue(testedForm.label_result.Text.Equals("Error"));
             *
             * testedForm.button_delete_Click(testedForm, e);
             */

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_7_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("355687428096000"));
        }
Example #2
0
        // Tests of factorial
        // Created by Yahor Senichak
        public void FactorialTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();


            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));
            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_5_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("120"));

            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("3628800"));

            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_0_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("1"));

            testedForm.button_delete_Click(testedForm, e);


            testedForm.button_1_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_7_Click(testedForm, e);
            testedForm.button_factorial_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("355687428096000"));
        }
Example #3
0
        // Tests of basic inputting
        public void EnteringTests()
        {
            // Creating of new object for testing
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Controlling if current text on the panel is equal to '...'
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            // Emulation of clicking on buttons '1' and '2'
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("12"));

            testedForm.button_remove_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("1"));

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("12345"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_6_Click(testedForm, e);
            testedForm.button_7_Click(testedForm, e);
            testedForm.button_8_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("67890"));

            testedForm.button_remove_Click(testedForm, e);
            testedForm.button_remove_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("678"));


            testedForm.button_remove_Click(testedForm, e);
            testedForm.button_remove_Click(testedForm, e);
            testedForm.button_remove_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));
        }
Example #4
0
        // Tests of minus
        // Created by Viktoryia Tomason
        public void MinusTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Emulation of clicking on buttons '-'
            testedForm.button_minus_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_minus_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_minus_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_7_Click(testedForm, e);
            testedForm.button_8_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_minus_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("78"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_minus_Click(testedForm, e);
            testedForm.button_minus_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_plus_Click(testedForm, e);
            testedForm.button_7_Click(testedForm, e);
            testedForm.button_minus_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("19"));
        }
Example #5
0
        // Tests of percent
        // Created by Viktoryia Tomason
        public void PercentTests()
        {
            // Creating of new object for testing
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Emulation of clicking on buttons '%'
            testedForm.button_percent_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_6_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("1,2"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_9_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("9"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_7_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,035"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_4_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("6"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_6_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,36"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_8_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_percent_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("-1,6"));
        }
Example #6
0
        // Tests of radical
        // Created by Viktoryia Tomason
        public void RadicalTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Emulation of clicking on buttons '√'
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("2"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_6_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("4"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_8_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("-2"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_4_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("Error"));

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_8_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("2"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to//
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,2"));
        }
Example #7
0
        // Tests of degree
        // Created by Yahor Senichak
        public void DegreeTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("8"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("1"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_0_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0"));


            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,0009765625"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("10"));


            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,5"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("25"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,01"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_8_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("Error"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_degree_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("Error"));
        }
Example #8
0
        // Tests of divide
        // Created by Viktoryia Tomason
        public void DivideTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Emulation of clicking on buttons '/'
            testedForm.button_divide_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("..."));

            testedForm.button_remove_Click(testedForm, e);

            testedForm.button_7_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_9_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("8"));
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("4"));
            testedForm.button_equal_Click(testedForm, e);//with equal
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0,5"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_1_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("1"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            Assert.IsTrue(testedForm.label_result.Text.Equals("0,5"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_4_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("∞"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_8_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_plus_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("34"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_9_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_divide_Click(testedForm, e);
            testedForm.button_7_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("-1"));
        }
Example #9
0
        // Tests of multiply
        // Created by Yahor Senichak
        public void MultiplyTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("529"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("0"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_dot_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_3_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("539,6329"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_8_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_multiply_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            testedForm.button_sign_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("-1008"));
        }
Example #10
0
        // Tests of radical
        // Created by Viktoryia Tomason
        public void RadicalTests()
        {
            ivs_project2.Form1 testedForm = new ivs_project2.Form1();
            EventArgs          e          = new EventArgs();

            // Emulation of clicking on buttons '√'
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_2_Click(testedForm, e);
            Assert.IsTrue(testedForm.label_result.Text.Equals("2"));

            testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_5_Click(testedForm, e);
            testedForm.button_6_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("4"));

            testedForm.button_delete_Click(testedForm, e);

            //!!!!ДОДЕЛАТЬ!!!!
            //testedForm.button_BINminus_Click(testedForm, e); "-"!!!если такая кнопка будет
            //testedForm.button_8_Click(testedForm, e);
            //testedForm.button_radical_Click(testedForm, e);
            //testedForm.button_3_Click(testedForm, e);
            //testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            // Assert.IsTrue(testedForm.label_result.Text.Equals("-2"));

            //testedForm.button_delete_Click(testedForm, e);

            testedForm.button_2_Click(testedForm, e);
            testedForm.button_0_Click(testedForm, e);
            testedForm.button_4_Click(testedForm, e);
            testedForm.button_8_Click(testedForm, e);
            testedForm.button_radical_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_1_Click(testedForm, e);
            testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to
            Assert.IsTrue(testedForm.label_result.Text.Equals("2"));

            testedForm.button_delete_Click(testedForm, e);

            //!!!ДОДЕЛАТЬ!!!
            //testedForm.button_2_Click(testedForm, e);
            //testedForm.button_5_Click(testedForm, e);
            //testedForm.button_radical_Click(testedForm, e);
            //testedForm.button_BINminus_Click(testedForm, e); "-"!!!
            //testedForm.button_2_Click(testedForm, e);
            //testedForm.button_equal_Click(testedForm, e);

            // Controlling if current text on the panel is equal to//
            //Assert.IsTrue(testedForm.label_result.Text.Equals("Error"));//Степень не может быть отрицательной
        }
Example #11
0
        static bool input(char symb, ivs_project2.Form1 profilingForm, EventArgs e)
        {
            bool res = false;

            switch (symb)
            {
            case '0':
                profilingForm.button_0_Click(profilingForm, e);
                res = true;
                break;

            case '1':
                profilingForm.button_1_Click(profilingForm, e);
                res = true;
                break;

            case '2':
                profilingForm.button_2_Click(profilingForm, e);
                res = true;
                break;

            case '3':
                profilingForm.button_3_Click(profilingForm, e);
                res = true;
                break;

            case '4':
                profilingForm.button_4_Click(profilingForm, e);
                res = true;
                break;

            case '5':
                profilingForm.button_5_Click(profilingForm, e);
                res = true;
                break;

            case '6':
                profilingForm.button_6_Click(profilingForm, e);
                res = true;
                break;

            case '7':
                profilingForm.button_7_Click(profilingForm, e);
                res = true;
                break;

            case '8':
                profilingForm.button_8_Click(profilingForm, e);
                res = true;
                break;

            case '9':
                profilingForm.button_9_Click(profilingForm, e);
                res = true;
                break;

            case ',':
                profilingForm.button_dot_Click(profilingForm, e);
                res = true;
                break;

            case '-':
                profilingForm.button_0_Click(profilingForm, e);
                profilingForm.button_sign_Click(profilingForm, e);
                res = true;
                break;
            }

            return(res);
        }