public void Should_stop_selenium_server()
        {
            SeleniumServer target = SeleniumServer.Create(_location, _package, false);

            target.Start();

            target.Stop();

            Assert.IsFalse(target.Started);

            target.Dispose();
        }
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            if (button1.Text == "Stop")
            {
                Task <bool> isTestRunning = Task.Run(() =>
                {
                    Task <bool> task = checkIfThereIsActiveTestsAreRunningAsync(txtBox_hubaddress.Text);
                    return(task);
                });

                isTestRunning.Wait();

                if (isTestRunning.Result)
                {
                    DialogResult result1 = MessageBox.Show("There are active tests still running. Closing the application will interrupt the results.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                    if (result1 == DialogResult.Yes)
                    {
                        notifyIcon1.Dispose();
                        seleniumServer.Stop(button1.Text);
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                else
                {
                    notifyIcon1.Dispose();
                    seleniumServer.Stop(button1.Text);
                }
            }
            else
            {
                notifyIcon1.Dispose();
                seleniumServer.Stop(button1.Text);
            }
        }