Exemplo n.º 1
0
        public void QueueTest_CreatingQueueWith3Elements_QueueHas3Element()
        {
            QueueT <string> qeue = new QueueT <string>(new List <string> {
                "asd", "asd", "aaa"
            });

            Assert.AreEqual(3, qeue.Count());
        }
Exemplo n.º 2
0
        public void QueueTest_Adding3Elements_QueueHas3Element()
        {
            QueueT <int> qeue = new QueueT <int>(1);

            qeue.Enqueue(1);
            qeue.Enqueue(3);
            qeue.Enqueue(3);

            Assert.AreEqual(3, qeue.Count());
        }
Exemplo n.º 3
0
        public void QueueTest_Add2ElementsAndTake1_QueueHas1Element()
        {
            QueueT <CastomForTest2> queue =
                new QueueT <CastomForTest2>(new List <CastomForTest2> {
                new CastomForTest2(1),
                new CastomForTest2(2)
            });

            queue.Dequeue();

            Assert.AreEqual(1, queue.Count());
        }
Exemplo n.º 4
0
        public void QueueTStrTests()
        {
            //arrange
            var myqueue = new QueueT <string>();

            //act
            myqueue.Enqueue("0");
            myqueue.Enqueue("1");
            myqueue.Enqueue("2");

            //assert
            Assert.AreEqual("0", myqueue.Dequeue());
            Assert.AreEqual("1", myqueue.Dequeue());
            Assert.AreEqual("2", myqueue.Dequeue());
            Assert.AreEqual(0, myqueue.Count());
        }
Exemplo n.º 5
0
        public void QueueTIntTests()
        {
            //arrange
            var myqueue = new QueueT <int>();

            //act
            myqueue.Enqueue(0);
            myqueue.Enqueue(1);
            myqueue.Enqueue(2);

            //assert
            Assert.AreEqual(0, myqueue.Dequeue());
            Assert.AreEqual(1, myqueue.Dequeue());
            Assert.AreEqual(2, myqueue.Dequeue());
            Assert.AreEqual(0, myqueue.Count());
        }