Ejemplo n.º 1
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         Controllers.StateController ctrl = new AutomatedTesting.GUI.Controllers.StateController();
         ctrl.SaveState();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Ejemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                _testController = new AutomatedTesting.GUI.Controllers.TestController(this);
                _testController.Initialize();

                Controllers.StateController ctrl = new AutomatedTesting.GUI.Controllers.StateController();
                ctrl.LoadState();

                foreach (string fileName in Context.AppContext.Instance.TreeState.ParametersFiles)
                {
                    TestParameters tp = TestParameters.Load(fileName);
                    if (tp != null)
                    {
                        testsTree.AddParametersSet(fileName, tp);
                    }
                }
                foreach (string fileName in Context.AppContext.Instance.TreeState.FeatureDefinitionFiles)
                {
                    FeatureDefinition def = FeatureDefinition.Load(fileName);
                    if (def != null)
                    {
                        testsTree.AddFeatureDefinitionNode(fileName, def);
                    }
                }
                foreach (string fileName in Context.AppContext.Instance.TreeState.TestFiles)
                {
                    TestSuite ts = TestSuite.Load(fileName);
                    if (ts != null)
                    {
                        testsTree.AddTestSuite(fileName, ts);
                        _testController.TestSuites.Add(ts);
                    }
                }
                foreach (string fileName in Context.AppContext.Instance.TreeState.DutTestFiles)
                {
                    DutTest ts = DutTest.Load(fileName);
                    if (ts != null)
                    {
                        testsTree.AddTestSuite(fileName, ts);
                        _testController.DutTests.Add(ts);
                    }
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }