Пример #1
0
        public void StringStringToLargeString()
        {
            string expected = "thisthat";

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

            myList.Add("this");
            myList.Add("that");
            string actual = myList.ToString();
        }
Пример #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]);
        }
Пример #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]);
        }
Пример #4
0
        public void ThreeIntsToString()
        {
            string expected = "123";

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

            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            string actual = myList.ToString();

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void AddThirdItem()
        {
            //arrange
            NateList <int> myList = new NateList <int>();

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

            //act
            int[] actual = myList.Add(3);
            //Assert
            Assert.AreEqual(expected, actual[2]);
        }
Пример #6
0
        public void AddIntStrings()
        {
            NateList <int> myList1 = new NateList <int>();

            myList1.Add(1);
            myList1.Add(2);
            NateList <int> myList2 = new NateList <int>();

            myList2.Add(3);
            myList2.Add(4);

            int[]          expected = { 1, 3, 2, 4 };
            NateList <int> actual   = myList1.Zipper(myList2);
        }
Пример #7
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]);
        }
Пример #8
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]);
        }
Пример #9
0
        public void AddIntStrings()
        {
            NateList <int> myList1 = new NateList <int>();

            myList1.Add(1);
            myList1.Add(2);
            NateList <int> myList2 = new NateList <int>();

            myList2.Add(1);
            myList2.Add(4);

            int[]          expected = { 1, 2, 4 };
            NateList <int> actual   = myList1 - myList2;

            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
            Assert.AreEqual(expected[2], actual[2]);
        }
Пример #10
0
        public void oneStringListPlusAnother()
        {
            NateList <string> myList1 = new NateList <string>();

            myList1.Add("hello");
            myList1.Add("hey");
            NateList <string> myList2 = new NateList <string>();

            myList2.Add("hello");
            myList2.Add("hey there");

            string[]          expected = { "hello", "hey", "hey there" };
            NateList <string> actual   = myList1 - myList2;

            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
            Assert.AreEqual(expected[2], actual[2]);
        }
Пример #11
0
        public void addDoubleToArray()
        {
            //arrange
            double expected = 23.5;
            //act
            NateList <double> myList = new NateList <double>();

            double[] actual = myList.Add(23.5);

            //Assert
            Assert.AreEqual(expected, actual[0]);
        }
Пример #12
0
        public void AddUnevenStringsReverse()
        {
            NateList <int> myList2 = new NateList <int>();

            myList2.Add(1);
            myList2.Add(2);
            NateList <int> myList1 = new NateList <int>();

            myList1.Add(3);
            myList1.Add(4);
            myList1.Add(5);
            myList1.Add(6);

            int[]          expected = { 1, 3, 2, 4, 5, 6, };
            NateList <int> actual   = myList2.Zipper(myList1);

            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
            Assert.AreEqual(expected[2], actual[2]);
            Assert.AreEqual(expected[3], actual[3]);
        }
Пример #13
0
        public void Hey_AddStringToArray_Spot1()
        {
            //arrange
            string expected = "hello";

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

            string[] actual = myList.Add("hello");

            //Assert
            Assert.AreEqual(expected, actual[0]);
        }
Пример #14
0
        public void AddIntToArray()
        {
            //arrange
            int expected = 1;


            //act
            NateList <int> myList = new NateList <int>();

            int[] actual = myList.Add(1);

            //Assert
            Assert.AreEqual(expected, actual[0]);
        }
Пример #15
0
        public void IteratorTestOne()
        {
            NateList <int> myList = new NateList <int>();

            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            myList.Add(4);
            myList.Add(5);
            myList.Add(6);

            int[] expected = { 1, 2, 3, 4, 5, 6 };

            Assert.AreEqual(expected[0], myList[0]);
            Assert.AreEqual(expected[1], myList[1]);
            Assert.AreEqual(expected[2], myList[2]);
            Assert.AreEqual(expected[3], myList[3]);
            Assert.AreEqual(expected[4], myList[4]);
            Assert.AreEqual(expected[5], myList[5]);
        }
Пример #16
0
        public void addSixNumbers()
        {
            //arrange
            int[] expected = { 1, 2, 3, 4, 5, 6, };

            //act
            NateList <int> myList = new NateList <int>();

            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            myList.Add(4);
            myList.Add(5);
            myList.Add(6);

            //Assert
            Assert.AreEqual(expected[0], myList[0]);
            Assert.AreEqual(expected[1], myList[1]);
            Assert.AreEqual(expected[2], myList[2]);
            Assert.AreEqual(expected[3], myList[3]);
            Assert.AreEqual(expected[4], myList[4]);
            Assert.AreEqual(expected[5], myList[5]);
        }
Пример #17
0
        public void Add14Numbers()
        {
            NateList <int> myList = new NateList <int>();

            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            myList.Add(4);
            myList.Add(5);
            myList.Add(6);
            myList.Add(7);
            myList.Add(8);
            myList.Add(9);
            myList.Add(10);
            myList.Add(11);
            myList.Add(12);
            myList.Add(13);
            myList.Add(14);
            int[] expected = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };

            Assert.AreEqual(expected[0], myList[0]);
            Assert.AreEqual(expected[1], myList[1]);
            Assert.AreEqual(expected[2], myList[2]);
            Assert.AreEqual(expected[3], myList[3]);
            Assert.AreEqual(expected[4], myList[4]);
            Assert.AreEqual(expected[5], myList[5]);
            Assert.AreEqual(expected[6], myList[6]);
            Assert.AreEqual(expected[7], myList[7]);
            Assert.AreEqual(expected[8], myList[8]);
            Assert.AreEqual(expected[9], myList[9]);
            Assert.AreEqual(expected[10], myList[10]);
            Assert.AreEqual(expected[11], myList[11]);
            Assert.AreEqual(expected[12], myList[12]);
            Assert.AreEqual(expected[13], myList[13]);
        }