#region CPL License /* Nuclex Framework Copyright (C) 2002-2009 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #endregion #if UNITTEST using System; using System.Collections.Generic; using NUnit.Framework; using NMock2; namespace Nuclex.Support.Collections { #if false /// Unit Test for the double ended queue [TestFixture] public class DequeTest { /// Verifies that the AddLast() method of the deque is working [Test] public void TestAddLast() { Deque intDeque = new Deque(16); for(int item = 0; item < 48; ++item) { intDeque.AddLast(item); } for(int item = 0; item < 48; ++item) { Assert.AreEqual(item, intDeque[item]); } } /// Verifies that the AddFirst() method of the deque is working [Test] public void TestAddFirst() { Deque intDeque = new Deque(16); for(int item = 0; item < 48; ++item) { intDeque.AddFirst(item); } for(int item = 0; item < 48; ++item) { Assert.AreEqual(47 - item, intDeque[item]); } } /// /// Verifies that the RemoveFirst() method of the deque is working /// [Test] public void TestRemoveFirst() { Deque intDeque = new Deque(16); for(int item = 0; item < 48; ++item) { intDeque.AddLast(item); } for(int item = 0; item < 48; ++item) { Assert.AreEqual(item, intDeque.First); Assert.AreEqual(48 - item, intDeque.Count); intDeque.RemoveFirst(); } } /// /// Verifies that the RemoveLast() method of the deque is working /// [Test] public void TestRemoveLast() { Deque intDeque = new Deque(16); for(int item = 0; item < 48; ++item) { intDeque.AddLast(item); } for(int item = 0; item < 48; ++item) { Assert.AreEqual(47 - item, intDeque.Last); Assert.AreEqual(48 - item, intDeque.Count); intDeque.RemoveLast(); } } } #endif } // namespace Nuclex.Support.Collections #endif // UNITTEST