Exemple #1
0
        public void testFront()
        {
            DEQueue <string> b = new DEQueue <string>();

            Assert.AreEqual(null, b.front());
            b.pushBack("abc");
            b.pushBack("cba");
            Assert.AreEqual("abc", b.front());
            Assert.IsTrue(b.Count == 2);
        }
        public void TestMethod1()//testFront
        {
            DEQueue <string> qwsda = new DEQueue <string>();

            qwsda.pushBack("KAte");
            qwsda.pushBack("LOLQOP");
            Assert.AreEqual(qwsda.front(), "KAte");
        }
Exemple #3
0
        public void FrontManyTest()
        {
            DEQueue <string> deq = new DEQueue <string>();

            deq.pushFront("a");
            deq.pushBack("b");
            deq.pushFront("c");
            Assert.AreEqual("c", deq.front().Data);
        }
Exemple #4
0
        public void front_Test2()
        {
            string           expected = "a";
            DEQueue <String> q        = new DEQueue <string>(); // Создание очереди для хранения строк

            q.pushBack("a");
            q.pushBack("b");
            q.pushBack("c");
            q.pushBack("d");
            string s = q.front();

            Assert.AreEqual(expected, s);
        }
Exemple #5
0
        public void pushBack_Test2()
        {
            string           expected = "5";
            DEQueue <String> q        = new DEQueue <string>(); // Создание очереди для хранения строк

            q.pushFront("5");                                   // 5
            q.pushFront("b");                                   // b 5
            q.pushFront("b");                                   // b b 5
            q.pushFront("q");                                   // q b b 5
            string s = q.front();

            Assert.AreEqual(expected, s);
        }
Exemple #6
0
        public void Main_Test2()
        {
            string           expected = "a";
            DEQueue <String> q        = new DEQueue <String>(); // Создание очереди для хранения строк

            q.pushFront("a");                                   // очередь: a
            q.pushFront("b");                                   // очередь: b a
            q.pushBack("c");                                    // очередь: b a c
            String s = q.front();                               // s = “b”

            s = q.pop();                                        // s = “c”;    очередь:  b a

            Assert.AreEqual(expected, s);
        }
Exemple #7
0
        public void FrontTest()
        {
            DEQueue <string> deq = new DEQueue <string>();

            Assert.IsNull(deq.front());
        }