Ejemplo n.º 1
0
        public void VerifyCountAfterAddSecondValue()
        {
            //Arrange
            WilliamsCustomList <int> willsList = new WilliamsCustomList <int>();
            int value        = 6;
            int secondValue  = 12;
            int expectResult = 12;

            //Act
            willsList.Add(value);
            willsList.Add(secondValue);

            //Assert //[1]
            Assert.AreEqual(expectResult, willsList[1]);
        }
Ejemplo n.º 2
0
        public void VerifyZeroIndex()
        {
            //Arrange
            WilliamsCustomList <int> willsList = new WilliamsCustomList <int>();
            int value          = 10;
            int expectedResult = 1;

            //Act
            willsList.Add(value);
            //Assert
            Assert.AreEqual(expectedResult, willsList.count);
        }
Ejemplo n.º 3
0
        public void VerifyTotalIndexCountValue()
        {
            //Arrange
            WilliamsCustomList <int> willsList = new WilliamsCustomList <int>();
            int value       = 6;
            int secondValue = 12;
            int thirdValue  = 18;
            int fourthValue = 24;
            int fifthValue  = 30;

            int expectResult = 5;

            //Act
            willsList.Add(value);
            willsList.Add(secondValue);
            willsList.Add(thirdValue);
            willsList.Add(fourthValue);
            willsList.Add(fifthValue);

            //Assert
            Assert.AreEqual(expectResult, willsList.count);
        }
Ejemplo n.º 4
0
        public void VerifyCountAfterAddMultipleValue()
        {
            //Arrange
            WilliamsCustomList <int> willsList = new WilliamsCustomList <int>();
            int value       = 6;
            int secondValue = 12;
            int thirdValue  = 18;
            int fourthValue = 24;
            int fifthValue  = 30;

            int expectResult = 30;

            //Act
            willsList.Add(value);
            willsList.Add(secondValue);
            willsList.Add(thirdValue);
            willsList.Add(fourthValue);
            willsList.Add(fifthValue);

            //Assert //[4]
            Assert.AreEqual(expectResult, willsList[4]);
        }
Ejemplo n.º 5
0
        public void VerifyCountAfterRemoveMultipleValues()
        {
            //Arrange
            WilliamsCustomList <int> willsList = new WilliamsCustomList <int>();
            int value          = 6;
            int secondValue    = 12;
            int thirdValue     = 18;
            int fourthValue    = 24;
            int expectedResult = 24;

            //Act
            willsList.Remove(value);
            willsList.Remove(secondValue);
            willsList.Remove(thirdValue);
            willsList.Add(fourthValue);
            //Assert
            Assert.AreEqual(expectedResult, willsList[0]);
        }