示例#1
0
        public PyTestMonForm(IEnumerable<SetupData> setupDataCollection, BrowserWriter browserWriter, TestFolderMonitor testFolderMonitor, string lastSetupName, TaskbarManager taskbarManager, TaskbarIcons taskbarIcons)
        {
            InitializeComponent();

            Setups.Items.AddRange(setupDataCollection.ToArray());

            browserWriter.Browser = Browser;

            _testFolderMonitor = testFolderMonitor;
            _taskbarManager = taskbarManager;
            _taskbarIcons = taskbarIcons;

            SetupData lastSetup = setupDataCollection.Where(x => x.Name == lastSetupName).SingleOrDefault();

            Setups.SelectedItem = lastSetup;

            _testFolderMonitor.TestRunComplete += TestRunComplete;

            SetControlState();
        }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);

            var settings = Properties.Settings.Default;

            var setupsSection = (SetupsSection)ConfigurationManager.GetSection("pytestmon");
            var browserWriter = new BrowserWriter();
            var testResultParser = new TestResultParser();
            var testRunner = new TestRunner(testResultParser);
            var taskbarManager = TaskbarManager.Instance;
            var taskbarIcons = new TaskbarIcons();
            var testFolderMonitor = new TestFolderMonitor(browserWriter, testRunner);

            var form = new PyTestMonForm(setupsSection.SetupData, browserWriter, testFolderMonitor, settings.LastSetup, taskbarManager, taskbarIcons);

            Application.Run(form);

            testFolderMonitor.Dispose();

            settings.LastSetup = form.LastSetupName;
            settings.Save();
        }