Exemple #1
0
        public void peek_should_return_null_when_buffer_empty()
        {
            var bufferDepth = 2;
            var queue = new QueueBuffer(bufferDepth: bufferDepth);

            queue.Peek().Should().Be.Null();
        }
Exemple #2
0
        public void peek_should_return_the_first_flit_put_on_queue()
        {
            var bufferDepth = 2;
            var queue = new QueueBuffer(bufferDepth: bufferDepth);
            var flit1 = new Flit();
            var flit2 = new Flit();

            queue.Put(flit1);
            queue.Put(flit2);

            var peek = queue.Peek();
            peek.Should().Be.EqualTo(flit1);
            peek.Should().Not.Be.EqualTo(flit2);
        }
Exemple #3
0
        public void should_not_decrease_items_count_after_peek_from_queue()
        {
            var bufferDepth = 2;
            var queue = new QueueBuffer(bufferDepth: bufferDepth);
            queue.Put(new Flit());

            var count = queue.Items.Count();
            queue.Peek();

            queue.Items.Count().Should().Be.EqualTo(count);
        }