示例#1
0
        public void Remove_CountDecreasesByOne_InputEqualsActual()
        {
            //arrange
            CustList <int> TestList = new CustList <int>();   // Testing to that the index count after is what one less than original, maybe this could also test that capacity remained the same

            TestList.Add(0);
            TestList.Add(1);
            TestList.Add(2);
            TestList.Add(3);
            //act
            TestList.Remove(1);
            int endCount       = 3;
            int actualEndCount = TestList.Count;      //index count should be 3, capacity still 4

            //assert
            Assert.AreEqual(endCount, actualEndCount);
        }
示例#2
0
        public void Remove_TakesCorrectIndexAway_InputEqualsActual()
        {
            //arrange
            CustList <string> TestList = new CustList <string>();  // Testing that the indexs are shifted to the left in the array (decreased an index)

            TestList.Add("a");
            TestList.Add("b");
            TestList.Add("c");
            TestList.Add("d");
            //act
            TestList.Remove("b");           // new array shoudl be [a, c, d, ,]

            string expectedString = TestList[1];

            //assert
            Assert.AreEqual(expectedString, "c");
            string expectedString2 = TestList[2];

            Assert.AreEqual(expectedString, "d");
            string expectedString3 = TestList[2];

            Assert.AreEqual(expectedString, " ");     // This test is the capacity remain 4 as well
        }