Beispiel #1
0
        public void testQueueAddMinValue()
        {
            CustomQueue<Element> customQueue = new CustomQueue<Element>();
            Element minElement = new Element(1, "This is min");

            customQueue.Enqueue(new Element(14, "This is not max"));
            customQueue.Enqueue(new Element(5, "This is not max"));
            customQueue.Enqueue(new Element(4, "This is not max"));
            customQueue.Enqueue(minElement);
            customQueue.Enqueue(new Element(2, "This is not max"));
            customQueue.Enqueue(new Element(7, "This is not max"));
            customQueue.Enqueue(new Element(9, "This is not max"));
            Assert.AreEqual(minElement.getText(), customQueue.LowerPriority().getText());
        }
Beispiel #2
0
        public void testQueueAddMinValue()
        {
            CustomQueue <Element> customQueue = new CustomQueue <Element>();
            Element minElement = new Element(1, "This is min");

            customQueue.Enqueue(new Element(14, "This is not max"));
            customQueue.Enqueue(new Element(5, "This is not max"));
            customQueue.Enqueue(new Element(4, "This is not max"));
            customQueue.Enqueue(minElement);
            customQueue.Enqueue(new Element(2, "This is not max"));
            customQueue.Enqueue(new Element(7, "This is not max"));
            customQueue.Enqueue(new Element(9, "This is not max"));
            Assert.AreEqual(minElement.getText(), customQueue.LowerPriority().getText());
        }