private void btnPause_Click(object sender, EventArgs e) { if (_testIsRunning) { _testIsRunning = false; _td.Pause(); btnPause.Text = "Continue"; } else { _testIsRunning = true; _td.Resume(); btnPause.Text = "Pause"; } }
/// <summary> /// Pauses tests execution. /// </summary> public void Pause() { switch (_td.State) { case TestState.Running: { _td.Pause(); } break; case TestState.Paused: { _td.Resume(); View.SwitchToState(ApplicationState.TestRunning); } break; case TestState.Idle: { System.Diagnostics.Debug.WriteLine("Pause button pressed when test is not running!"); } break; } }