public void IsEmpty_ItemsExist_ReturnsFalse()
        {
            var dequeue      = new DeQueue <string>();
            var firstElement = "first element";

            dequeue.PushFront(firstElement);

            dequeue.IsEmpty().Should().Be(false);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var deqeue = new DeQueue <string>();

            PopulateTestData(deqeue);
            Console.WriteLine("Popping it all in front :");
            while (!deqeue.IsEmpty())
            {
                Console.Write(deqeue.PopFront() + ' ');
            }
            Console.WriteLine();

            PopulateTestData(deqeue);
            Console.WriteLine("Popping it all in back :");
            while (!deqeue.IsEmpty())
            {
                Console.Write(deqeue.PopBack() + ' ');
            }
            Console.WriteLine();
            Console.ReadKey();
        }
        public void IsEmpty_AllItemsPoped_ReturnsTrue()
        {
            var dequeue      = new DeQueue <string>();
            var firstElement = "first element";

            dequeue.PushFront(firstElement);

            var secondElement = "secondElement element";

            dequeue.PushFront(secondElement);

            dequeue.PopFront();
            dequeue.PopBack();
            dequeue.IsEmpty().Should().Be(true);
        }
        public void IsEmpty_NoItemsPushed_ReturnsTrue()
        {
            var dequeue = new DeQueue <string>();

            dequeue.IsEmpty().Should().Be(true);
        }