public void CircularQueuePush3ItemAndPop3GetCountAndIsEmpty() { int maxSize = 100; var myQueue = new MyCircularQueue(maxSize); myQueue.Push(1); myQueue.Push("1"); myQueue.Push("A"); var obj = myQueue.Pop(); obj = myQueue.Pop(); obj = myQueue.Pop(); Assert.AreEqual("A", obj); Assert.AreEqual(true, myQueue.IsEmpty()); }
public void CircularQueueEmptyAndPop() { int maxSize = 3; var myQueue = new MyCircularQueue(maxSize); var obj = myQueue.Pop(); Assert.IsNull(obj); }
public void CircularQueueFullAndPopPush5Times() { int maxSize = 3; var myQueue = new MyCircularQueue(maxSize); myQueue.Push("A"); myQueue.Push("B"); myQueue.Push("C"); myQueue.Pop(); myQueue.Push("D"); myQueue.Pop(); myQueue.Push("E"); myQueue.Pop(); myQueue.Push("F"); myQueue.Pop(); myQueue.Push("G"); Assert.AreEqual("EFG", myQueue.ItemToString()); }
public void CircularQueuePush10ItemAndToString2() { int maxSize = 10; var myQueue = new MyCircularQueue(maxSize); myQueue.Push("A"); myQueue.Push("B"); myQueue.Push("C"); myQueue.Push("D"); myQueue.Push("E"); myQueue.Push("F"); myQueue.Push("G"); myQueue.Push("H"); myQueue.Push("I"); myQueue.Push("J"); myQueue.Pop(); myQueue.Pop(); myQueue.Pop(); Assert.AreEqual("DEFGHIJ", myQueue.ItemToString()); }
public void CircularQueuePush3ItemAndPopGetCount() { int maxSize = 100; var myQueue = new MyCircularQueue(maxSize); myQueue.Push(1); myQueue.Push("1"); myQueue.Push("A"); var obj = myQueue.Pop(); Assert.AreEqual(1, obj); Assert.AreEqual(2, myQueue.GetCount()); }