public void TestRemoveLast() { Deque<int> intDeque = new Deque<int>(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(); } }
public void TestThrowOnRemoveLastFromEmptyDeque() { Deque<int> intDeque = new Deque<int>(); Assert.Throws<InvalidOperationException>( delegate() { intDeque.RemoveLast(); } ); }