Esempio n. 1
0
        public void MyArrayList_6_ToString_1_OnEmptyList()
        {
            // Arrange
            IMyArrayList lst      = DSBuilder.CreateMyArrayList();
            String       expected = "NIL";

            // Act
            String actual = lst.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void MyArrayList_6_ToString_2_OnSingleElement()
        {
            // Arrange
            IMyArrayList lst      = DSBuilder.CreateMyArrayList();
            String       expected = "[3]";

            // Act
            lst.Add(3);
            String actual = lst.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void MyArrayList_6_ToString_3_OnFullList()
        {
            // Arrange
            IMyArrayList lst      = DSBuilder.CreateMyArrayList();
            String       expected = "[1,2,3,4,5]";

            // Act
            lst.Add(1);
            lst.Add(2);
            lst.Add(3);
            lst.Add(4);
            lst.Add(5);
            String actual = lst.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 4
0
        public void MyArrayList_6_ToString_5_AfterClear()
        {
            // Arrange
            IMyArrayList lst      = DSBuilder.CreateMyArrayList();
            String       expected = "NIL";

            // Act
            lst.Add(1);
            lst.Add(2);
            lst.Add(3);
            lst.Add(4);
            lst.Add(5);
            lst.Clear();
            String actual = lst.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }