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); }
private static void TestIsReadOnly(MyList <int> myList) { Debug.Assert(myList.IsReadOnly == false); Console.WriteLine("Is the list ready only? {0}\n", myList.IsReadOnly); }
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)); }
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); }
private static void TestRemoveAt(MyList <int> myList) { myList.RemoveAt(1); Debug.Assert(myList.Contains(3) == false); Console.Write("New list: [{0}]", string.Join(", ", myList)); }
private static void TestClear(MyList <int> myList) { myList.Clear(); Debug.Assert(myList.Count == 0); Console.Write("New list: [{0}]", string.Join(", ", myList)); }
public myEnumerator(MyList <T> myList) { this.myList = myList; index = -1; }