public void RunAsService() { SampleInstaller.Delete(); SampleInstaller.Create(); using (var controller = GetController()) { Assert.Equal(ServiceControllerStatus.Stopped, controller.Status); controller.Start(); controller.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(15)); controller.Refresh(); Assert.Equal(ServiceControllerStatus.Running, controller.Status); controller.Stop(); controller.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(15)); controller.Refresh(); Assert.Equal(ServiceControllerStatus.Stopped, controller.Status); SampleInstaller.Delete(); } }
public void Install() { SampleInstaller.Delete(); SampleInstaller.Create(); }