コード例 #1
0
        public void Remove_ItemOfEmptyLIst_CheckCountEqualsZero()
        {
            // arrange
            CustomsListClass <int> testList = new CustomsListClass <int>();
            int expected = 0;
            int actual;

            // act
            testList.Remove(1);
            actual = testList.Count;

            // assert
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void ToString_AList_ReturnOnlyOneThreeFour()
        {
            // arrange
            CustomsListClass <int> testList = new CustomsListClass <int>();
            string expected = "134";
            string actual;

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

            // assert
            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void Remove_ItemFour_CheckCountEqualsToThree()
        {
            // arrange
            CustomsListClass <int> testList = new CustomsListClass <int>();
            int expected = 4;
            int actual;

            // act
            testList.Add(1);
            testList.Add(2);
            testList.Add(3);
            testList.Add(4);
            testList.Add(5);
            testList.Remove(4);
            actual = testList.Count;

            // assert
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void Remove_ItemTwo_CheckIndexTwo()
        {
            // arrange
            CustomsListClass <int> testList = new CustomsListClass <int>();
            int expected = 4;
            int actual;

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

            // assert
            Assert.AreEqual(expected, actual);
        }
コード例 #5
0
        public void Remove_ItemThree_CheckItemThreeAtIndexFour()
        {
            // arrange
            CustomsListClass <int> testList = new CustomsListClass <int>();
            int expected = 3;
            int actual;

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

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