public void TestGetServiceStatus_ISSAdminStopped() { string status = _appMonitorService.GetServiceStatus(serverName, serviceName); Assert.AreEqual("Running", status); _appMonitorService.StopService(serverName, serviceName); status = _appMonitorService.GetServiceStatus(serverName, serviceName); Assert.AreEqual("Stopped", status); Console.WriteLine(@"IISAdmin Service Status: " + status); }
public async void StopService(ApplicationService service) { IsBusy = true; var stopServiceTask = Task.Factory.StartNew(() => _statusMonitorService.StopService(service.ServerName, service.ServiceName)); await stopServiceTask.ContinueWith(e => { if (e.IsCompleted) { IsBusy = false; SelectedService.Status = e.Result; SelectedService.Image = GetImageSource(SelectedService.Status); } }); RaiseContextMenuCanExceute(); }