Ejemplo n.º 1
0
        public void TC_SimpleQueue()
        {
            var queue = new SimpleQueue <double>();

            var input = GetDoubleTestList();

            foreach (var item in input)
            {
                queue.Add(item, item);
            }
            Assert.AreEqual(input.Count, queue.GetSize());

            List <double> poppedItems = new List <double>();

            while (queue.GetSize() > 0)
            {
                poppedItems.Add(queue.RemoveMin());
            }
            Assert.IsTrue(CollectionsEquality.Equals(input, poppedItems));

            queue.Clear();
            Assert.AreEqual(0, queue.GetSize());
            Assert.AreEqual("Simple Queue", queue.GetName());
        }