Exemple #1
0
        public void RemoveTwoItems()
        {
            string expected = "things";

            NateList <string> myList = new NateList <string>();

            myList.Add("this");
            myList.Add("that");
            myList.Add("those");
            myList.Add("things");
            myList.Remove("that");
            myList.Remove("those");

            Assert.AreEqual(expected, myList[1]);
        }
Exemple #2
0
        public void RemoveFirstItem()
        {
            string expected = "second";

            NateList <string> myList = new NateList <string>();

            myList.Add("first");
            myList.Add("second");
            myList.Remove("first");

            Assert.AreEqual(expected, myList[0]);
        }
Exemple #3
0
        public void One_Remove_One()
        {
            NateList <int> myList = new NateList <int>();

            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            int expected = 3;

            myList.Remove(2);

            Assert.AreEqual(expected, myList[1]);
        }
Exemple #4
0
        public void IteratorTestStrings()
        {
            NateList <string> myList = new NateList <string>();

            myList.Add("hey");
            myList.Add("hello");
            myList.Add("Helloo");
            myList.Remove("hello");
            myList.Add("hello");
            myList.Add("bye");

            string[] expected = { "hey", "Helloo", "hello", "bye" };

            Assert.AreEqual(expected[0], myList[0]);
            Assert.AreEqual(expected[1], myList[1]);
            Assert.AreEqual(expected[2], myList[2]);
            Assert.AreEqual(expected[3], myList[3]);
        }