예제 #1
0
        public void DeleteFirstOneElemADTListHeadTailCountTest()
        {
            // Arrange
            var emptyList = new ADTList <int>().AddLast(1);

            // Act
            emptyList.DeleteFirst();
            // Assert
            Assert.AreEqual(null, emptyList.Head);
            Assert.AreEqual(null, emptyList.Tail);
            Assert.AreEqual(0, emptyList.Count);
        }
예제 #2
0
        public void DeleteFirstTwoElemADTListHeadTailCountTest()
        {
            // Arrange
            var emptyList = new ADTList <int>().AddLast(1).AddLast(2);

            // Act
            emptyList.DeleteFirst();
            // Assert
            Assert.AreSame(emptyList.Head, emptyList.Tail);
            Assert.AreEqual(2, emptyList.Head.Data);
            Assert.AreEqual(2, emptyList.Tail.Data);
            Assert.AreEqual(1, emptyList.Count);
        }