public void ModifyIndividualServiceState() { var host = new MultitaskingServiceHost(); var serviceId = host.Install(new FakeHostedService()); host.Start(serviceId); Assert.AreEqual(ServiceHostState.Started, host.State); Thread.Sleep(100); Assert.AreEqual(HostedServiceState.Started, host.GetState(serviceId)); host.Cancel(serviceId); Assert.AreEqual(ServiceHostState.Stopped, host.State); Assert.AreEqual(HostedServiceState.Stopped, host.GetState(serviceId)); }
public void CancelFailsForMissingService() { var host = new MultitaskingServiceHost(); host.Cancel(Guid.NewGuid()); }