Example #1
0
        public async Task StartNow_ExecutesEventImmediately()
        {
            var timer = new FfsTimer();

            timer.Elapsed += ActionToPerform;

            timer.StartNow(100000);
            timer.Stop();
            _numberOfExecutions.Should().Be(1);
        }
Example #2
0
        public async Task StartNow_ExecutesFurtherEvents()
        {
            var timer = new FfsTimer();

            timer.Elapsed += ActionToPerform;

            timer.StartNow(1000);
            await Task.Delay(1000);

            timer.Stop();

            _numberOfExecutions.Should().Be(2);
        }