Exemplo n.º 1
0
 private void saveBtn_Click(object sender, EventArgs e)
 {
     //Сохранение (сериализация) тест-сьюта в xml
     DialogResult dialogResult;
     if (projextNameTxt.Text != string.Empty)
     {
         saveTestSuiteDialog.FileName = projextNameTxt.Text;
     }
     dialogResult = saveTestSuiteDialog.ShowDialog();
     if (dialogResult == DialogResult.OK)
     {
         var treeViewSerializer = new TreeViewStateSerializer();
         treeViewSerializer.SerializeObject(_executionTests, string.Format("{0}.trxml", saveTestSuiteDialog.FileName));
         FormSerializator.Serialize(this, saveTestSuiteDialog.FileName);
     }
 }
Exemplo n.º 2
0
        private void loadBtn_Click(object sender, EventArgs e)
        {
            //Загрузка сохраненного тест-сьюта (xml) в программу
            DialogResult dialogResult = loadSavedTestSuiteDialog.ShowDialog();
            if (dialogResult == DialogResult.OK)
            {
                string filePath = loadSavedTestSuiteDialog.FileName;
                FormSerializator.Deserialize(this, filePath);
                var treeViewSerializer = new TreeViewStateSerializer();
                _executionTests = treeViewSerializer.DeSerializeObject<List<string>>(string.Format("{0}.trxml", filePath));

                _runner = new NunitTestRunner(projextNameTxt.Text);
                _result = _runner.LoadAssembly(textBox1.Text.Substring(0,textBox1.Text.Length - 1).Split(';'));
                RefreshTreeView();
                var builder = new StringBuilder();
                SetProjectInfo(builder);
                textBox2.Text = builder.ToString();
            }
        }