Ejemplo n.º 1
0
 public AddTestSuiteFileEventArgs(string[] fileNames)
 {
     int i = 0;
     _fileEntries = new TestSuiteFileEntry[fileNames.Count()];
     foreach (string fileName in fileNames)
     {
         _fileEntries[i++] = new TestSuiteFileEntry(fileName, null, null, null, -1); // [REVISIT] future code must insert a proper index
     }
 }
Ejemplo n.º 2
0
 public TestSuiteFileEntry AddTestFile(string fileName)
 {
     TestSuiteFileEntry entry = new TestSuiteFileEntry(fileName, null, null, null, entryIndex);
     _items.Add(entry);
     entryIndex++;
     return entry;
 }
Ejemplo n.º 3
0
 public TestSuiteFileEntry InsertTestFile(int index, TestSuiteFileEntry entry)
 {
     _items.Insert(index, entry);
     return entry;
 }
Ejemplo n.º 4
0
 public TestSuiteFileEntry InsertTestFile(int index, string fileName)
 {
     TestSuiteFileEntry entry = new TestSuiteFileEntry(fileName, null, null, null, entryIndex);
     _items.Insert(index, entry);
     return entry;
 }
Ejemplo n.º 5
0
 public void AddTestFile(string fileName, string astRefFileName, string irRefFileName, string soRefFileName)
 {
     TestSuiteFileEntry entry = new TestSuiteFileEntry(fileName, astRefFileName, irRefFileName, soRefFileName, entryIndex);
     entryIndex++;
     _items.Add(entry);
 }
Ejemplo n.º 6
0
        private DialogResult SaveFile(TestSuiteFileEntry fileEntry, bool queryUser)
        {
            DialogResult rc = DialogResult.OK;

            if (null != fileEntry)
            {
                if (fileEntry.Changed)
                {
                    if (queryUser)
                    {
                        rc = MessageBox.Show("Save file " + fileEntry.FileName, "Save File", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    }
                    else
                        rc = DialogResult.Yes;

                    if (DialogResult.Yes == rc)
                    {
                        TextBox tb = tcFiles.SelectedTab.Controls[0] as TextBox;

                        Debug.Assert(tb != null, "TextBox == null");

                        try
                        {
                            _cmdSaveFile.Execute(fileEntry.FileName, tb.Text);
                        }
                        catch (Exception ex)
                        {
                            DisplayException(ex);
                        }
                    }
                    else if (DialogResult.Cancel == rc)
                    {
                        return DialogResult.Cancel;
                    }
                }
            }
            return rc;
        }
Ejemplo n.º 7
0
        private void ExecuteTestSuiteItems(TreeNode parent)
        {
            string fileName;

            if (parent.Checked)
            {
                foreach (TreeNode node in parent.Nodes)
                {
                    if (node.Checked)
                    {
                        if (null != (_currentTestFileEntry = (node.Tag as TestSuiteFileEntry)))
                        {
                            fileName = _currentTestFileEntry.FileName;

                            txtConsole.Text += Header(fileName);
                            txtAST.Text += Header(fileName);
                            txtIntRep.Text += Header(fileName);

                            if (tcFiles.TabPages.ContainsKey(fileName))
                            {
                                TabPage tabPage = tcFiles.TabPages[fileName];
                                TextBox textBox = tabPage.Controls[0] as TextBox;

                                Debug.Assert(null != textBox, "");

                                _cmdRunStart.Execute(fileName, textBox.Text);
                            }
                            else
                            {
                                _cmdRunStart.Execute(fileName);
                            }
                        }
                        else if (null != (node.Tag as TestSuiteSuiteEntry))
                        {
                            ExecuteTestSuiteItems(node);
                        }
                    }
                }
            }
        }