예제 #1
0
        public async Task Dispatch_OneAction_ShouldDispatchOneAction()
        {
            // arrange
            var context = new Mock <IExecutionTaskContext>();

            context.Setup(t => t.Register(It.IsAny <IExecutionTask>()));

            var scheduler = new BatchScheduler();

            ValueTask Dispatch() => default;

            scheduler.Schedule(Dispatch);
            Assert.True(scheduler.HasTasks);

            // act
            await scheduler.DispatchAsync();

            // assert
            Assert.False(scheduler.HasTasks);
        }