Ejemplo n.º 1
0
 static void Main()
 {
     //Add method test
     Console.WriteLine("Add method test and accessing it by index and auto grow functunality");
     GenericList<int> someList = new GenericList<int>();
     //Auto grow funcutunality test
     for (int index = 0; index < 7; index++)
     {
         someList.Add(index);
         //Accessing element
         Console.Write(someList[index] + " ");
     }
     Console.WriteLine();
     Console.WriteLine("Removint method test");
     //Removint method test
     someList.Remove(1);
     Console.WriteLine(someList.ToString());
     Console.WriteLine();
     Console.WriteLine("Insert method test");
     //Insert method test
     someList.Insert(7, 1);
     Console.WriteLine(someList.ToString());
     Console.WriteLine();
     //FindValue method test
     Console.WriteLine("Value found first on index {0}",someList.FindValue(4));
     Console.WriteLine();
     //Clear method test
     someList.Clear();
     Console.WriteLine(someList.ToString());
     someList.Add(5);
     someList.Add(3);
     Console.WriteLine(someList.ToString());
     //Min method test
     Console.WriteLine("Min method test");
     Console.WriteLine(someList.Min<int>());
     //Max method test
     Console.WriteLine("Max method test");
     Console.WriteLine(someList.Max<int>());
 }