public static WindowsServiceCondition IsRunning(IWindowsServiceConditionMetadata check) { var chk = new WindowsServiceCondition(check.ServiceName, check.TimeOut); chk.Predicate = chk.IsRunning; chk.Message = string.Format("Check that the service named '{0}' is running.", check.ServiceName); return(chk); }
public WindowsServiceCondition Instantiate(IWindowsServiceConditionMetadata check) { if (check is IWindowsServiceRunningMetadata) { return(WindowsServiceCondition.IsRunning(check)); } throw new ArgumentException(); }