示例#1
0
        public void Add_AddToPopulatedList_ItemShouldGoToIndexZero()
        {
            CustomListTest <int> test = new CustomListTest <int>();
            int expected = 1;
            int actual;

            test.Add(1);
            actual = test[0];
            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void Remove_RemoveFromPopulatedList_CapacityShouldReturntoFour()
        {
            CustomListTest <int> test = new CustomListTest <int>();
            int expected = 5;
            int actual;

            test.Add(5);
            actual = test[4];
            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void Add_AddToPopulatedList_ItemShouldGoToIndexEight()
        {
            CustomListTest <int> test = new CustomListTest <int>();
            int expected = 9;
            int actual;

            test.Add(9);
            actual = test.Add[8];
            Assert.AreEqual(expected, actual);
        }
示例#4
0
        public void Add_AddToEmptyList_ItemShouldGoToIndexFour()
        {
            CustomListTest <int> test = new CustomListTest <int>();

            int expected = 5;
            int actual;

            test.Add(5);
            actual = test[4];
            Assert.AreEqual(expected, actual);
        }
示例#5
0
        public void Add_AddToEmptyList_ItemShouldGoToIndexZero()
        {
            //arrange
            CustomListTest <int> test = new CustomListTest <int>();
            int expected = 4;
            int actual;

            //act
            test.Add(4);
            actual = test[0];
            Assert.AreEqual(expected, actual);
        }
示例#6
0
        public void Add_AddToEmptyList_CountShouldIncreaseToOne()
        {
            //arrange
            CustomListTest <int> test = new CustomListTest <int>();
            int expected = 1;
            int actual;

            //act
            test.Add(1);
            actual = test.Count;
            //assert
            Assert.AreEqual(expected, actual);
        }