Пример #1
0
 public void AddFirst_OnValidParam_ContainsExpectedItems(int[] expectedItems)
 {
     foreach (var item in expectedItems)
     {
         _linkedList.AddFirst(item);
     }
     Assert.Contains(expectedItems, item => _linkedList.Contains(item));
 }
Пример #2
0
 public void AddFirst_OnValidParam_ContainsExpectedItems(int[] expectedItems)
 {
     //Act
     foreach (var item in expectedItems)
     {
         _linkedList.AddFirst(item);
     }
     //Assert
     CollectionAssert.AreEquivalent(_linkedList, expectedItems);
 }
Пример #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);
        }
Пример #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);
        }