Dev2.Services.ServerServiceConfiguration.StartService C# (CSharp) Method

StartService() public method

public StartService ( ) : bool
return bool
        public bool StartService()
        {
            if(ServiceManager == null)
            {
                throw new Exception("Null Service Manager");
            }

            if(!ServiceManager.IsRunning())
            {
                if(!ServiceManager.Start())
                {
                    PopupController.Show("A time out occurred while trying to start the Warewolf server service. Please try again.", "Timeout", MessageBoxButton.OK, MessageBoxImage.Error, null);
                    return false;
                }
            }

            return true;
        }

Usage Example

        public void ServerServiceConfiguration_StartService_WhenServiceConfigurationNull_ExpectException()
        {
            //------------Setup for test--------------------------
            var serverServiceConfiguration = new ServerServiceConfiguration(null);

            //------------Execute Test---------------------------
            serverServiceConfiguration.StartService();

        }