public void Restart() => Invoke(() => { var src = new SpoolerService(); src.Stop(); src.Stop(); // ignore Assert.That(src.Status, Is.EqualTo(ServiceControllerStatus.Stopped)); src.Start(); src.Start(); // ignore Assert.That(src.Status, Is.EqualTo(ServiceControllerStatus.Running)); });
public virtual void Setup() { var service = new SpoolerService(); if (service.Status != ServiceControllerStatus.Running) { service.Start(); } }