Exemplo n.º 1
0
        public void Should_Peek_Throw_If_Empty()
        {
            //arrange
            var queue = new MyLinkedListQueue <int>();

            //act
            Action act = () => queue.Peek();

            //assert
            act.ShouldThrow <InvalidOperationException>();
        }
Exemplo n.º 2
0
        public void Should_Create_With_Collection()
        {
            //arrange
            var array = new int[] { 1, 2, 3, 4, 5 };

            //act
            var queue = new MyLinkedListQueue <int>(array);

            //assert
            queue.Count.ShouldBeEquivalentTo(5);
            queue.Peek().ShouldBeEquivalentTo(1);
        }
Exemplo n.º 3
0
        public void Should_Peek()
        {
            //arrange
            var queue = new MyLinkedListQueue <int>();

            queue.Enqueue(5);
            //act
            var result = queue.Peek();

            //assert
            queue.Count.ShouldBeEquivalentTo(1);
            result.ShouldBeEquivalentTo(5);
        }