public void Launch_WithSampleAppPresent_CorrectOutput() { Task.Run(async() => { await Task.Delay(3000); ApplicationLifecycle.Shutdown(); }); Lifecycle.Program.Main(new[] { "." }); _consoleOutputCollector.Output.Should().Contain("OnStart called"); _consoleOutputCollector.Output.Should().Contain("OnStop called"); }
public void Launch_WithMultipleAppsPresent_SelectsCorrectEntrypoint() { var otherExeName = "ZampleServices.exe"; File.Copy("SampleServices.exe", otherExeName, true); Environment.SetEnvironmentVariable("WINDOWS_SERVICE_EXE", otherExeName); Task.Run(async() => { await Task.Delay(3000); ApplicationLifecycle.Shutdown(); }); Lifecycle.Program.Main(new[] { "." }); _consoleOutputCollector.Output.Should().Contain($"{otherExeName} as the service entry point executable"); }