コード例 #1
0
        public void TestQueueAdd()
        {
            var queue = new LavalinkQueue();

            Assert.Empty(queue);

            queue.Add(DummyTrack);

            Assert.NotEmpty(queue);
            Assert.Single(queue);

            queue.Add(DummyTrack);

            Assert.Equal(2, queue.Count);

            queue.Clear();

            Assert.Empty(queue);
        }
コード例 #2
0
        public void TestQueueClear()
        {
            var queue = new LavalinkQueue();

            Assert.Empty(queue);

            queue.Add(DummyTrack);

            Assert.NotEmpty(queue);
            Assert.Equal(1, queue.Clear());
            Assert.Empty(queue);

            queue.Add(DummyTrack);

            Assert.NotEmpty(queue);

            ((ICollection <LavalinkTrack>)queue).Clear();

            Assert.Empty(queue);
        }