Esempio n. 1
0
        private void OnOK(object sender, EventArgs e)
        {
            Core.SettingsManager settingsMgr = new Core.SettingsManager();

            settingsMgr["SuccessColor"] = _successColorDisplay.BackColor;
            settingsMgr["FailureColor"] = _failureColorDisplay.BackColor;

            settingsMgr["AutoExpandTestHierarchy"] = _cbAutoExpand.Checked;
            settingsMgr["ExpandCommentNodes"]      = _cbExpandCommentNodes.Checked;
            settingsMgr["ShowLineNumbersInOutput"] = _cbShowLineNumbers.Checked;
            settingsMgr["ExpandExecutedTestNodes"] = _cbExpandExecutedTestNodes.Checked;

            ConfigCurrentUser config = new ConfigCurrentUser();

            config.AskForSafeOnModifiedUntitled = _cbAskForSafeOnModifiedUntitled.Checked;
            switch (_cbStartupLoadItem.SelectedIndex)
            {
            case 0:
                config.StartupLoadItem = "Nothing";
                break;

            case 1:
                config.StartupLoadItem = "Recipe";
                break;

            case 2:
                config.StartupLoadItem = "Assembly";
                break;
            }

            Close();
        }
Esempio n. 2
0
        private void OptionsForm_Load(object sender, EventArgs e)
        {
            Core.SettingsManager settingsMgr = new Core.SettingsManager();

            _settingsList.Items.Clear();
            foreach (string setting in SettingsManager.Settings)
            {
                _settingsList.Items.Add(setting);
            }

            _successColorDisplay.BackColor     = (Color)settingsMgr["SuccessColor"];
            _failureColorDisplay.BackColor     = (Color)settingsMgr["FailureColor"];
            _cbAutoExpand.Checked              = (bool)settingsMgr["AutoExpandTestHierarchy"];
            _cbExpandCommentNodes.Checked      = (bool)settingsMgr["ExpandCommentNodes"];
            _cbShowLineNumbers.Checked         = (bool)settingsMgr["ShowLineNumbersInOutput"];
            _cbExpandExecutedTestNodes.Checked = (bool)settingsMgr["ExpandExecutedTestNodes"];

            ConfigCurrentUser config = new ConfigCurrentUser();

            _cbAskForSafeOnModifiedUntitled.Checked = config.AskForSafeOnModifiedUntitled;

            switch (config.StartupLoadItem)
            {
            case "Nothing":
            default:
                _cbStartupLoadItem.SelectedItem = "nothing.";
                break;

            case "Recipe":
                _cbStartupLoadItem.SelectedItem = "most recently used Recipe.";
                break;

            case "Assembly":
                _cbStartupLoadItem.SelectedItem = "most recently used TestAssembly.";
                break;
            }
        }
Esempio n. 3
0
 private void ReadFromSettings() {
    _recentAssemblies = new ConfigCurrentUser().RecentAssemblies;
 }
Esempio n. 4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var config = new ConfigCurrentUser();

            Location = config.MainFormLocation;
            Size     = config.MainFormSize;

            Command.CreateCommands(this, _csUnitControl);
            Command.FillToolStrip(_toolStrip);

            if (_clh.HasOption("recipe"))
            {
                if (Utils.FileExists(_clh.GetOptionValueFor("recipe"), true))
                {
                    RecipeFactory.Load(_clh.GetOptionValueFor("recipe"));
                }
            }
            else if (_clh.HasOption("assembly"))
            {
                if (Utils.FileExists(_clh.GetOptionValueFor("assembly"), true))
                {
                    var assemblyPathName = _clh.GetOptionValueFor("assembly");
                    if (!Path.IsPathRooted(assemblyPathName))
                    {
                        assemblyPathName = Path.Combine(Environment.CurrentDirectory, assemblyPathName);
                    }
                    RecipeFactory.Current.AddAssembly(assemblyPathName);
                }
            }
            else
            {
                switch (config.StartupLoadItem)
                {
                case "Recipe":
                    if (config.RecentRecipies.Count > 0 &&
                        Utils.FileExists(config.RecentRecipies[0], true))
                    {
                        RecipeFactory.Load(config.RecentRecipies[0]);
                    }
                    break;

                case "Assembly":
                    if (config.RecentAssemblies.Count > 0 &&
                        Utils.FileExists(config.RecentAssemblies[0], true))
                    {
                        RecipeFactory.Current.AddAssembly(config.RecentAssemblies[0]);
                    }
                    break;
                }
            }

            // Setup the xml handler
            if (_clh.HasOption("xml"))
            {
                _xmlWriter = new DefaultXmlWriter(RecipeFactory.Current, _clh.GetOptionValueFor("xml"));
            }

            // Automatically start the recipe
            if (_clh.HasOption("autorun"))
            {
                if (RecipeFactory.Current != null)
                {
                    var testRun = new TestRun(new AllTestsCriterion());
                    RecipeFactory.Current.RunTests(testRun);
                }
            }
        }
Esempio n. 5
0
 private void ReadFromSettings()
 {
     _recentAssemblies = new ConfigCurrentUser().RecentAssemblies;
 }
Esempio n. 6
0
        private void ReadFromSettings()
        {
            var config = new ConfigCurrentUser();

            _recentRecipies = config.RecentRecipies;
        }
Esempio n. 7
0
      private void OptionsForm_Load(object sender, EventArgs e) {
         Core.SettingsManager settingsMgr = new Core.SettingsManager();

         _settingsList.Items.Clear();
         foreach(string setting in SettingsManager.Settings) {
            _settingsList.Items.Add(setting);
         }

         _successColorDisplay.BackColor = (Color)settingsMgr["SuccessColor"];
         _failureColorDisplay.BackColor = (Color)settingsMgr["FailureColor"];
         _cbAutoExpand.Checked = (bool)settingsMgr["AutoExpandTestHierarchy"];
         _cbExpandCommentNodes.Checked = (bool)settingsMgr["ExpandCommentNodes"];
         _cbShowLineNumbers.Checked = (bool)settingsMgr["ShowLineNumbersInOutput"];
         _cbExpandExecutedTestNodes.Checked = (bool) settingsMgr["ExpandExecutedTestNodes"];

         ConfigCurrentUser config = new ConfigCurrentUser();
         
         _cbAskForSafeOnModifiedUntitled.Checked = config.AskForSafeOnModifiedUntitled;

         switch(config.StartupLoadItem) {
            case "Nothing":
            default:
               _cbStartupLoadItem.SelectedItem = "nothing.";
               break;
            case "Recipe":
               _cbStartupLoadItem.SelectedItem = "most recently used Recipe.";
               break;
            case "Assembly":
               _cbStartupLoadItem.SelectedItem = "most recently used TestAssembly.";
               break;
         }
      }
Esempio n. 8
0
      private void OnOK(object sender, EventArgs e) {
         Core.SettingsManager settingsMgr = new Core.SettingsManager();

         settingsMgr["SuccessColor"] = _successColorDisplay.BackColor;
         settingsMgr["FailureColor"] = _failureColorDisplay.BackColor;

         settingsMgr["AutoExpandTestHierarchy"] = _cbAutoExpand.Checked;
         settingsMgr["ExpandCommentNodes"] = _cbExpandCommentNodes.Checked;
         settingsMgr["ShowLineNumbersInOutput"] = _cbShowLineNumbers.Checked;
         settingsMgr["ExpandExecutedTestNodes"] = _cbExpandExecutedTestNodes.Checked;
         
         ConfigCurrentUser config = new ConfigCurrentUser();
         config.AskForSafeOnModifiedUntitled  = _cbAskForSafeOnModifiedUntitled.Checked;
         switch(_cbStartupLoadItem.SelectedIndex) {
            case 0:
               config.StartupLoadItem = "Nothing";
               break;
            case 1:
               config.StartupLoadItem = "Recipe";
               break;
            case 2:
               config.StartupLoadItem = "Assembly";
               break;
         }

         Close();
      }
Esempio n. 9
0
 private void ReadFromSettings() {
    var config = new ConfigCurrentUser();
    _recentRecipies = config.RecentRecipies;
 }