コード例 #1
0
        public void Helpers_getOpenForm_Test()
        {
            Helpers      testHelpers      = new Helpers();
            MainKeyboard testMainKeyboard = new MainKeyboard();

            Greek testGreek = new Greek();

            testGreek.openFormForTest();
            testGreek.setTempForm();

            SetTheory_Logic testSetTheory = new SetTheory_Logic();

            testSetTheory.openFormForTest();
            testSetTheory.setTempForm();


            Form testForm = new Form(); // Creating a Form object with no name, getOpenForms can not possibly return matching name when this object is passed in
            // as an argument and there are no open forms. ie if no forms are open , getOpenforms will return this object, whose name is null

            Form GreekTest        = testHelpers.getOpenForm(testForm, "Greek");
            Form MainKeyboardTest = testHelpers.getOpenForm(testForm, "MainKeyboard");
            Form SetTheoryTest    = testHelpers.getOpenForm(testForm, "SetTheory_Logic");

            Assert.AreEqual(testGreek.Name, GreekTest.Name);
            Assert.AreEqual(testMainKeyboard.Name, MainKeyboardTest.Name);
            Assert.AreEqual(testSetTheory.Name, SetTheoryTest.Name);
        }
コード例 #2
0
        public void SetTheory_ButtonClick_Test()
        {
            SetTheory_Logic testSetTheory = new SetTheory_Logic();

            testSetTheory.openFormForTest();
            testSetTheory.setTempForm();
            EventArgs e = new EventArgs();

            testSetTheory.button1_Click(testSetTheory.Universal, e);
            String testString  = testSetTheory.tempText;
            String testString2 = testSetTheory.Universal.Text;

            Assert.AreEqual(testString, testString2);
        }