예제 #1
0
 public void Task_ContainsQueue_Test()
 {
     //Arrange
     MyLibrary.Queue <object> MyQueue = new MyLibrary.Queue <object>();
     //Act
     MyQueue.Enqueue(1);
     MyQueue.Enqueue(2);
     MyQueue.Enqueue(3);
     //Assert
     Assert.Contains(2, MyQueue);
 }
예제 #2
0
 public void Task_ClearQueue_Test()
 {
     //Arrange
     MyLibrary.Queue <object> MyQueue = new MyLibrary.Queue <object>();
     MyQueue.Enqueue(1);
     MyQueue.Enqueue(2);
     MyQueue.Enqueue(3);
     //Act
     MyQueue.Clear();
     //Assert
     Assert.Empty(MyQueue);
 }
예제 #3
0
        public void Task_Show_TheFirstElement_Test()
        {
            //Arrange
            System.Collections.Generic.Queue <object> TestQueue = new System.Collections.Generic.Queue <object>();
            TestQueue.Enqueue(1);
            TestQueue.Enqueue(2);
            TestQueue.Enqueue(3);
            MyLibrary.Queue <object> MyQueue = new MyLibrary.Queue <object>();
            MyQueue.Enqueue(1);
            MyQueue.Enqueue(2);
            MyQueue.Enqueue(3);
            //Act
            object firstitem = TestQueue.Peek();
            object firstelem = MyQueue.PeekFirst;

            //Assert
            Assert.Equal(firstitem, firstelem);
        }
예제 #4
0
        public void Task_Add_Element_Test()
        {
            //Arrange
            System.Collections.Generic.Queue <object> TestQueue = new System.Collections.Generic.Queue <object>();
            MyLibrary.Queue <object> MyQueue = new MyLibrary.Queue <object>();
            //Act
            TestQueue.Enqueue(1);
            TestQueue.Enqueue(2);
            TestQueue.Enqueue(3);
            MyQueue.Enqueue(1);
            MyQueue.Enqueue(2);
            MyQueue.Enqueue(3);

            /*foreach (object item in TestQueue)
             * {
             *  foreach(object elem in MyQueue)
             *  {
             *      Assert.Equal(item, elem);
             *  }
             * }*/
            //Assert
            Assert.Equal(TestQueue, MyQueue);
        }