public async Task ItInvokesOnStart() { // Arrange var host = new TestServiceHost(); var container = CreateTestContainer(); var service = new TestService(TestName, host); // Act await service.Start(container); // Assert Assert.True(service.WasStarted); }
public async Task ItConfiguresShutdownTokenToCallOnShutdown() { // Arrange var host = new TestServiceHost(); var container = CreateTestContainer(); var service = new TestService(TestName, host); await service.Start(container); // Act host.Shutdown(); // Assert Assert.True(service.WasShutdown); }