Beispiel #1
0
 public void AddFirst_OnValidParam_ContainsExpectedItems(int[] expectedItems)
 {
     foreach (var item in expectedItems)
     {
         _linkedList.AddFirst(item);
     }
     Assert.Contains(expectedItems, item => _linkedList.Contains(item));
 }
Beispiel #2
0
 public void AddFirst_OnValidParam_ContainsExpectedItems(int[] expectedItems)
 {
     //Act
     foreach (var item in expectedItems)
     {
         _linkedList.AddFirst(item);
     }
     //Assert
     CollectionAssert.AreEquivalent(_linkedList, expectedItems);
 }
Beispiel #3
0
        public void LinkedListAddFirstIsNotEmpty()
        {
            //Arrange
            DataStructures.Linear.LinkedList<int> linkedList = new DataStructures.Linear.LinkedList<int>();

            //Act
            linkedList.AddFirst(0);

            //Assert
            Assert.IsFalse(linkedList.IsEmpty);
        }
Beispiel #4
0
        public void LinkedListRemoveFirst()
        {
            //Arrange
            DataStructures.Linear.LinkedList<int> linkedList = new DataStructures.Linear.LinkedList<int>();

            //Act
            linkedList.AddFirst(0);
            linkedList.RemoveFirst();

            //Assert
            Assert.IsTrue(linkedList.IsEmpty);
        }