Exemple #1
0
        public void ExpireEvent_DoesNothing_NoEvent()
        {
            var rand  = new Random(1234);
            var queue = new TestQueue();

            for (ulong i = 0; i < 1000; i++)
            {
                var nextRole = rand.Next(0, 3) switch
                {
                    0 => FFXIVRole.DPS,
                    1 => FFXIVRole.Healer,
                    2 => FFXIVRole.Tank,
                    _ => throw new NotImplementedException(),
                };
                queue.Enqueue(i, nextRole, null);
            }

            queue.ExpireEvent(null);

            var slots = queue.GetAllSlots();

            foreach (var slot in slots)
            {
                Assert.That(string.IsNullOrEmpty(slot.EventId));
            }
        }
Exemple #2
0
        public void ExpireEvent_Works_Event()
        {
            var rand  = new Random(1234);
            var queue = new TestQueue();

            for (ulong i = 0; i < 1000; i++)
            {
                var nextRole = rand.Next(0, 3) switch
                {
                    0 => FFXIVRole.DPS,
                    1 => FFXIVRole.Healer,
                    2 => FFXIVRole.Tank,
                    _ => throw new NotImplementedException(),
                };
                queue.Enqueue(i, nextRole, EventId);
            }

            queue.ExpireEvent(EventId);

            var slots = queue.GetAllSlots();

            Assert.That(!slots.Any());
        }