Пример #1
0
        public void TestScheduleManyHappyDelivery()
        {
            using var holder = new CounterHolder(500);
            scheduler.Schedule(scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1));

            holder.Completes();

            Assert.Equal(500, holder.Counter);
        }
Пример #2
0
        public void TestScheduleOnceOneHappyDelivery()
        {
            using var holder = new CounterHolder(1);
            _scheduler.ScheduleOnce(_scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1));

            holder.Completes();

            Assert.Equal(1, holder.Counter);
        }