AccidentalFish.ApplicationSupport.Core.Tests.Unit.Policies.Implementation.AsynchronousIntervalTimerTests.ReturningFalseCancelsTimerWithoutCancellationToken C# (CSharp) Метод

ReturningFalseCancelsTimerWithoutCancellationToken() приватный Метод

private ReturningFalseCancelsTimerWithoutCancellationToken ( ) : Task
Результат Task
        public async Task ReturningFalseCancelsTimerWithoutCancellationToken()
        {
            // Arrange
            Mock<IAsynchronousDelay> delay = new Mock<IAsynchronousDelay>();
            AsynchronousIntervalTimer timer = new AsynchronousIntervalTimer(delay.Object, TimeSpan.FromMilliseconds(PretendDelayInMilliseconds), false);
            int repeatCount = 0;

            // Act
            await timer.ExecuteAsync(() =>
            {
                repeatCount++;
                return Task.FromResult(false);
            });

            // Assert
            Assert.AreEqual(1, repeatCount);
        }