Example #1
0
        public void TestClear()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            ints.Clear();
            Assert.AreEqual(0, ints.Count);
        }
Example #2
0
        public void TestIndexOf()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            Assert.AreEqual(1, ints.IndexOf(ints[1]));
            Assert.AreEqual(-1, ints.IndexOf(9));
        }
Example #3
0
        public void TestContains()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            Assert.IsTrue(ints.Contains(2));
            Assert.IsFalse(ints.Contains(9));
        }
Example #4
0
        public void TestAdd()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            ints.Add(6);
            Assert.AreEqual(6, ints[ints.Count - 1]);
        }
Example #5
0
 public void TestInsert()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     ints.Insert(2, 8);
     Assert.AreEqual(8, ints[2]);
     Assert.AreEqual(3, ints[3]);
     Assert.AreEqual(5, ints[5]);
 }
Example #6
0
        public void TestInsert()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            ints.Insert(2, 8);
            Assert.AreEqual(8, ints[2]);
            Assert.AreEqual(3, ints[3]);
            Assert.AreEqual(5, ints[5]);
        }
Example #7
0
 public void TestIndexOf()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     Assert.AreEqual(1, ints.IndexOf(ints[1]));
     Assert.AreEqual(-1, ints.IndexOf(9));
 }
Example #8
0
 public void TestIndex()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     Assert.AreEqual(5, ints[ints.Count - 1]);
 }
Example #9
0
 public void TestContains()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     Assert.IsTrue(ints.Contains(2));
     Assert.IsFalse(ints.Contains(9));
 }
Example #10
0
 public void TestClear()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     ints.Clear();
     Assert.AreEqual(0, ints.Count);
 }
Example #11
0
 public void TestAdd()
 {
     MyListNodes<int> ints = new MyListNodes<int>(new int[] { 1, 2, 3, 4, 5 });
     ints.Add(6);
     Assert.AreEqual(6, ints[ints.Count - 1]);
 }
Example #12
0
        public void TestIndex()
        {
            MyListNodes <int> ints = new MyListNodes <int>(new int[] { 1, 2, 3, 4, 5 });

            Assert.AreEqual(5, ints[ints.Count - 1]);
        }