Beispiel #1
0
 public void ThrowsOutOfIndex()
 {
     // Arrange
     var sut = new QuackedList();
     // Act
     // Assert
     var item = sut[0];
 }
Beispiel #2
0
        public void CanAddMember()
        {
            // Arrange
            var sut = new QuackedList();

            // Act
            sut.Add("Test");
            // Assert
            Assert.AreEqual(1, sut.Count);
        }
Beispiel #3
0
        public void CanPrintEmptyList()
        {
            // Arrange
            var sut = new QuackedList();

            // Act
            // Assert
            Assert.AreEqual("", sut.ToString());
            Assert.AreEqual("", sut.ToStringReverse());
        }
Beispiel #4
0
        public void RetrievesMembersByIndex()
        {
            var sut  = new QuackedList();
            var item = "Test";

            // Act
            sut.Add(item);
            // Assert
            Assert.AreEqual(item, sut[0]);
        }
Beispiel #5
0
        public void SupportsNullValues()
        {
            // Arrange
            var sut = new QuackedList();

            sut.Add(null);
            // Act
            // Assert
            Assert.AreEqual("", sut.ToString());
            Assert.AreEqual("", sut.ToStringReverse());
        }
Beispiel #6
0
        public void CanSetHeadElement()
        {
            // Arrange
            var sut  = new QuackedList();
            var item = "Test";

            // Act
            sut.Add(item);
            // Assert
            Assert.AreEqual(item, sut.Head);
        }
Beispiel #7
0
        public void CanRemoveMemberByIndex()
        {
            // Arrange
            var sut  = new QuackedList();
            var item = "Test";

            // Act
            sut.Add(item);
            sut.RemoveAt(0);
            // Assert
            Assert.AreEqual(0, sut.Count);
        }
Beispiel #8
0
        public void CanPrintMembersReverse()
        {
            // Arrange
            var sut = new QuackedList();

            // Act
            sut.Add("1");
            sut.Add("2");
            sut.Add("3");
            sut.Add("5");
            sut.Add("7");
            // Assert
            Assert.AreEqual("7,5,3,2,1", sut.ToStringReverse());
        }