private void mnuEditTest_Click(object sender, System.EventArgs e)
        {
            string caption = "Edit Test";
            UnitTestManagerEditForm editingDialog = new UnitTestManagerEditForm(caption, inspectorConfig);

            editingDialog.TestName = lstTestManager.SelectedItems[0].SubItems[0].Text;
            editingDialog.TestType = lstTestManager.SelectedItems[0].SubItems[1].Text;

            // populate other values
            editingDialog.TestArgs = this.FormTests.GetByIndex(lstTestManager.SelectedIndices[0]).Arguments;

            if ( editingDialog.ShowDialog() == DialogResult.OK )
            {
                this.UpdateTest(editingDialog);

                ListViewItem item = lstTestManager.SelectedItems[0];
                item.SubItems.Clear();
                item.Text = editingDialog.TestName;
                item.SubItems.Add(editingDialog.TestType);

                AddOtherInformation(_tests[editingDialog.TestName]);
            }

            editingDialog.Close();
        }
        private void UpdateTest(UnitTestManagerEditForm editForm)
        {
            if ( _tests.ContainsKey(editForm.TestName) )
            {
                // update
                Test test = this.FormTests[editForm.TestName];
                test.TestType = editForm.HtmlFormTestType;
                test.Arguments = editForm.TestArgs;

                if ( test.TestType == HtmlFormTest.Predefined )
                {
                    ((PredefinedTesterArgs)test.Arguments).FormData = this.CurrentForm;
                }
                test.TestTypeName = editForm.TestType;
            }
            else
            {
                // add
                Test test = new Test();
                test.Name=editForm.TestName;
                test.TestType = editForm.HtmlFormTestType;
                test.Arguments = editForm.TestArgs;

                if ( test.TestType == HtmlFormTest.Predefined )
                {
                    ((PredefinedTesterArgs)test.Arguments).FormData = this.CurrentForm;
                }

                test.TestTypeName = editForm.TestType;

                this.FormTests.Add(test.Name,test);
            }
        }
        private void mnuAddTest_Click(object sender, System.EventArgs e)
        {
            string caption = "Add Test";
            UnitTestManagerEditForm editingDialog = new UnitTestManagerEditForm(caption,this.inspectorConfig);

            if ( editingDialog.ShowDialog() == DialogResult.OK )
            {

                this.UpdateTest(editingDialog);

                ListViewItem item = new ListViewItem();
                item.Text=editingDialog.TestName;
                item.SubItems.Add(editingDialog.TestType);
                AddOtherInformation(_tests[editingDialog.TestName]);

                lstTestManager.Items.Add(item);
            }

            editingDialog.Close();
        }