예제 #1
0
파일: MultiForm.cs 프로젝트: minskowl/MY
        private void button1_Click(object sender, EventArgs e)
        {
            int i = int.Parse(myLabel.Text) + 1;

            myLabel.Text = i.ToString();

            MultiForm newForm = new MultiForm();

            newForm.Name = Name + "-" + (i - 1);
            newForm.Text = newForm.Name;
            newForm.Show();
        }
예제 #2
0
        public void TestMultipleFormsShouldNotFindLastButton()
        {
            MultiForm form = new MultiForm();

            form.Show();

            ButtonTester buttonOne   = new ButtonTester("myButton", "Form");
            ButtonTester buttonTwo   = new ButtonTester("myButton", "Form-0");
            ButtonTester buttonThree = new ButtonTester("myButton", "Form-0-0");
            ButtonTester buttonFour  = new ButtonTester("myButton", "Form-1");

            buttonOne.Click();
            buttonTwo.Click();
            buttonThree.Click();
            buttonFour.Click();
        }
예제 #3
0
파일: FormTest.cs 프로젝트: minskowl/MY
        public void Close()
        {
            using (MultiForm formMultiForm = new MultiForm())
            {
                formMultiForm.Show();
                ButtonTester myButton = new ButtonTester("myButton");
                using (FormTester form = new FormTester("Form"))
                {
                    Assert.IsTrue(myButton.Properties.Visible);
                    form.Close();

                    try
                    {
                        bool shouldNotGetMe = myButton.Properties.Visible;
                        Assert.Fail("found control after closing form");
                    }
                    catch (NoSuchControlException)
                    {
                    }
                }
            }
        }