Exemple #1
0
        public void TestClearThenEnqueue()
        {
            var _queryService = new QueueService();

            _queryService.Clear();
            _queryService.Enqueue(1);
            _queryService.Enqueue(2);
            _queryService.Enqueue(44);
            _queryService.Clear();
            _queryService.Enqueue(22);
            var id = _queryService.Peek();

            Assert.NotEqual(1, id);
        }
Exemple #2
0
        public void TestPeek()
        {
            var _queryService = new QueueService();

            _queryService.Clear();
            _queryService.Enqueue(1);
            var id = _queryService.Peek();

            Assert.Equal(1, id);
        }
Exemple #3
0
        public void TestDequeueAfterPeek()
        {
            var _queryService = new QueueService();

            _queryService.Clear();
            _queryService.Enqueue(111);
            _queryService.Enqueue(34);
            var peekId    = _queryService.Peek();
            var dequeueId = _queryService.Dequeue();

            Assert.Equal(dequeueId, peekId);
        }
Exemple #4
0
        public void TestPeekAfterDequeue()
        {
            var _queryService = new QueueService();

            _queryService.Clear();
            _queryService.Enqueue(1);
            _queryService.Enqueue(347);
            var dequeueId = _queryService.Dequeue();
            var id        = _queryService.Peek();

            Assert.Equal(347, id);
        }
Exemple #5
0
        public void TestDequeue()
        {
            var _queryService = new QueueService();

            _queryService.Clear();
            _queryService.Enqueue(1);
            _queryService.Enqueue(2);
            var idNotSame = _queryService.Dequeue();
            var id        = _queryService.Peek();

            Assert.NotEqual(idNotSame, id);
        }