Beispiel #1
0
 private static void TestInterface(MyList <int> myList)
 {
     Debug.Assert(myList is MyList <int> == true, "The object doesn't implement the interface.");
     Console.WriteLine("Does the list implement MyList interface? {0}\n", myList is MyList <int> == true);
 }
Beispiel #2
0
 private static void TestIsReadOnly(MyList <int> myList)
 {
     Debug.Assert(myList.IsReadOnly == false);
     Console.WriteLine("Is the list ready only? {0}\n", myList.IsReadOnly);
 }
Beispiel #3
0
 private static void TestIndexOf(MyList <int> myList, int value)
 {
     Debug.Assert(myList.Contains(value));
     Console.WriteLine("The index of 7 is: {0}\n", myList.IndexOf(value));
 }
Beispiel #4
0
 private static void TestCount(MyList <int> myList, int count)
 {
     Debug.Assert(myList.Count == count, "The total count doesn't match.");
     Console.WriteLine(" Items in list: {0}\n", myList.Count);
 }
Beispiel #5
0
 private static void TestRemoveAt(MyList <int> myList)
 {
     myList.RemoveAt(1);
     Debug.Assert(myList.Contains(3) == false);
     Console.Write("New list: [{0}]", string.Join(", ", myList));
 }
Beispiel #6
0
 private static void TestClear(MyList <int> myList)
 {
     myList.Clear();
     Debug.Assert(myList.Count == 0);
     Console.Write("New list: [{0}]", string.Join(", ", myList));
 }
Beispiel #7
0
 public myEnumerator(MyList <T> myList)
 {
     this.myList = myList;
     index       = -1;
 }