public void Executive_can_be_started_and_stopped() { executive.Start().Wait(); Assert.AreEqual(State.Running, executive.State); executive.Stop().Wait(); Assert.AreEqual(State.Stopped, executive.State); }
/// <summary> /// Aborts the model. /// </summary> public virtual void Abort() { if (s_diagnostics) { _Debug.WriteLine("Model.Abort() requested."); } Exec.Stop(); m_stateMachine.DoTransition(GetAbortEnum()); if (!IsReady) { IsRunning = false; IsReady = false; IsPaused = false; IsCompleted = true; } }
private void StopAndRestartExec(object obj) { System.Threading.Thread.Sleep(1000); IExecutive exec = (IExecutive)obj; Debug.WriteLine("\r\n" + "Pausing for two seconds..." + "\r\n"); Debug.WriteLine("Before pause, Exec state is " + exec.State); exec.Stop(); System.Threading.Thread.Sleep(2000); Debug.WriteLine("After pause, Exec state is " + exec.State); Debug.WriteLine("\r\n" + "Resuming..." + "\r\n"); exec.Start(); Debug.WriteLine("Exec state is now " + exec.State); }
public void Stop() { executive.Stop().Wait(); }