Example #1
0
        static void Main()
        {
            Console.WriteLine(GSM.IPhone4S);   // => The static field

            GSM firstGSM = new GSM("Samsung A500F Galaxy A5", "Samsung", 300.99, "Samanta", new Battery(BatteryType.LiIon, 30.45, 28.18),
            new Display(58900000, 8.8, 5.8));

            GSM secondGSM = new GSM("LG Joy H220", "LG", 201.99, "George", new Battery(BatteryType.NiCd, 25.55, 12.04),
                new Display(80540000, 10.5, 6.2));

            GSM thirdGSM = new GSM("Nokia Lumia 730 Dual SIM", "Nokia", 599.99, "Michael", new Battery(BatteryType.NiMH, 35.12, 30.10),
                new Display(90020000, 9.9, 5.5));

            GSM fourthGSM = new GSM("Alcatel OneTouch Hero", "Alcatel", 99.20, "Stefcheto", new Battery(BatteryType.LiIon, 12.20, 8.12),
                new Display(522000, 7.6, 5.2));

            GSM[] collectionGSM = new GSM[4];  // => Add GSM instances in array

            collectionGSM[0] = firstGSM;
            collectionGSM[1] = secondGSM;
            collectionGSM[2] = thirdGSM;
            collectionGSM[3] = fourthGSM;

            GSM_Test test = new GSM_Test(collectionGSM);  // => Print GSM instances
            test.showGsmInfo();

            GsmCallHistoryTest.AddTestCallsInHistory();         // => Add definited calls from array into the List<Calls>
            GsmCallHistoryTest.DisplayCalltestHistory();       // => Print the call history for the moment
            Console.WriteLine(Environment.NewLine);

            GsmCallHistoryTest.CalculateAndPrintTestcallsPrice();  // => Calculate and print the price of all calls in the List<Calls) with fixed price 0.37
            Console.WriteLine(Environment.NewLine);

            Console.WriteLine("The longest call is removing...");
            GsmCallHistoryTest.RemoveLongestCall();                     // => Remove the longest call from the List<Calls>
            Console.WriteLine(Environment.NewLine);

            Console.WriteLine("After the longest call was removed:");
            Console.WriteLine(Environment.NewLine);

            GsmCallHistoryTest.CalculateAndPrintTestcallsPrice();  // => Calculate and print the price of all calls in the List<Calls) with fixed price 0.37
            Console.WriteLine(Environment.NewLine);                // after the removing longest call

            GsmCallHistoryTest.DisplayCalltestHistory();    // => Print call history
            Console.WriteLine(Environment.NewLine);

            Console.WriteLine("Now the phone calls are clearing from the history...");
            GsmCallHistoryTest.testGSM.ClearCallHistory();      // => Clear data history
            Console.WriteLine(Environment.NewLine);

            GsmCallHistoryTest.DisplayCalltestHistory();      // => Print empty history
            Console.WriteLine("WELL DONE\n");
        }
Example #2
0
 public GSM_Test(GSM[] gsmCollection)
 {
     this.gsmCollection = gsmCollection;
 }