Esempio n. 1
0
        public void Remove_RemoveFromListofOne_ReturnEmptyList()
        {
            //arrange
            KyleCustomList <int> testList = new KyleCustomList <int>();
            int expected = 0;
            int actual;


            //act
            testList.Add(1);
            testList.Remove(1);
            actual = testList.count;

            //assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void Remove_ReduceCount_ReduceCountByOne()
        {
            //arrange
            KyleCustomList <int> testList = new KyleCustomList <int>();
            int expected = 2;
            int actual;


            //act
            testList.Add(4);
            testList.Add(1);
            testList.Add(2);
            testList.Remove(1);
            actual = testList.count;

            //assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void Remove_RemoveOnlyFirstInstance_LaterInstancesStillThere()
        {
            //arrange
            KyleCustomList <int> testList = new KyleCustomList <int>();
            int expected = 4;
            int actual;


            //act
            testList.Add(2);
            testList.Add(4);
            testList.Add(4);
            testList.Add(6);
            testList.Remove(4);
            actual = testList[1];

            //assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 4
0
        public void Remove_RemoveFromMiddleOfList_ScootIndexOver()
        {
            //arrange
            KyleCustomList <int> testList = new KyleCustomList <int>();
            int expected = 0;
            int actual;


            //act
            testList.Add(2);
            testList.Add(4);
            testList.Add(7);
            testList.Add(6);
            testList.Remove(6);
            actual = testList[3];

            //assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 5
0
        public void Remove_RemoveNothing_ReturnSameList()
        {
            //arrange
            KyleCustomList <int> testList = new KyleCustomList <int>();
            KyleCustomList <int> expected = testList;
            KyleCustomList <int> actual;


            //act
            testList.Add(3);
            testList.Add(6);
            testList.Add(4);
            testList.Add(8);
            testList.Remove(1);
            actual = testList;

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