示例#1
0
        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();
        }