Beispiel #1
0
        public void AddAndRemove_Int_InList()
        {
            //Arrange
            CustomBuiltList <int> myList = new CustomBuiltList <int>();
            int value          = 1;
            int expectedResult = 0;

            //Act
            myList.Add(value);
            myList.Remove(value);
            int actualResult = myList.Count;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Beispiel #2
0
        public void Find_Int_InList()
        {
            //Arrange
            CustomBuiltList <int> myList = new CustomBuiltList <int>()
            {
                1, 2, 4, 6, 7, 20, 3, 5
            };
            int value          = 3;
            int expectedResult = 5;

            //Act
            myList.Remove(value);
            int actualResult = myList[6];

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Beispiel #3
0
        public void Remove_String_InList()
        {
            //Arrange
            CustomBuiltList <string> myList = new CustomBuiltList <string>()
            {
                "test"
            };
            string value          = "test";
            int    expectedResult = 0;

            //Act
            myList.Remove(value);
            int actualResult = myList.Count;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Beispiel #4
0
        public void Find_String_InList()
        {
            //Arrange
            CustomBuiltList <string> myList = new CustomBuiltList <string>()
            {
                "test", "thing", "otherThing"
            };
            string value          = "thing";
            string expectedResult = "otherThing";

            //Act
            myList.Remove(value);
            string actualResult = myList[1];

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Beispiel #5
0
        public void Remove_Int_EndOfLongList()
        {
            //Arrange
            CustomBuiltList <int> myList = new CustomBuiltList <int>()
            {
                1, 5, 8, 7, 24, 57, 68, 4, 5, 6, 3, 4, 5, 9, 10, 30, 23, 43, 45
            };
            int value          = 45;
            int expectedResult = 43;

            //Act
            myList.Remove(value);
            int actualResult = myList[17];

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }