示例#1
0
        /// <summary>
        /// Configures the test host, which simply starts and stops the service. Meant to be used
        /// to verify the service can be created, started, stopped, and disposed without issues.
        /// </summary>
        public static HostConfigurator UseTestHost(this HostConfigurator configurator)
        {
            configurator.UseHostBuilder((environment, settings) => new TestBuilder(environment, settings));
            configurator.ApplyCommandLine("");

            return configurator;
        }
		public static void UseLinuxIfAvailable(this HostConfigurator configurator)
		{
			if (MonoHelper.RunninOnLinux)
			{
				// Needed to overcome mono-service style arguments.
				configurator.ApplyCommandLine(MonoHelper.GetUnparsedCommandLine());
				configurator.UseEnvironmentBuilder((cfg) => new LinuxHostEnvironmentBuilder(cfg));
			}
		}