Ejemplo n.º 1
0
 public void INOUt()
 {
     CustomQueue test = new CustomQueue();
     test.Enqueue(1);
     test.Enqueue(2);
     Assert.AreEqual(1,test.Dequeue());
     Assert.AreEqual(2,test.Dequeue());
     test.Enqueue(3);
     test.Enqueue(4);
     Assert.AreEqual(3,test.Dequeue());
     Assert.AreEqual(4,test.Dequeue());
 }
Ejemplo n.º 2
0
        public void exception()
        {
            CustomQueue test = new CustomQueue();

            try
            {
                test.Dequeue();
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Empty queue", ex.Message);
            }
        }