public async Task StartAsync_WithTestLockManager_TaskIsExecuted() { bool executed = false; var service = new TestDistributedBackgroundService(_ => { executed = true; return(Task.CompletedTask); }, new TestLockManager()); await service.StartAsync(CancellationToken.None); AsyncTestingUtil.Wait(() => executed); executed.Should().BeTrue(); }