Пример #1
0
        static void Main()
        {
            GSM gsm = new GSM("3310", "Nokia", 2000, "Joro Chernoto Lale", new Battery("modelche", 500, 100, BatteryType.LiIon), new Display(15, 15000000));

            Console.WriteLine(gsm.ToString());
            GSMTest.GSMTesting();
            GSMCallHistoryTest.CallsTesting();
        }
Пример #2
0
 public static void GSMTesting()
 {
     GSM[] arrOfGsm = new GSM[2];
     arrOfGsm[0] = new GSM("One", "HTC", 1300, "Prasko", new Battery("HTC", 50, 20, BatteryType.LiIon), new Display(15, 18000000));
     arrOfGsm[1] = new GSM("One", "HTC", 1300, "Prasko", new Battery("HTC", 50, 20, BatteryType.LiIon), new Display(15, 18000000));
     foreach (GSM gsm in arrOfGsm)
     {
         Console.WriteLine(gsm);
     }
     Console.WriteLine(GSM.Iphone4S);
 }
        public static void CallsTesting()
        {
            GSM firstGsm = new GSM("S6Edge", "Samsung", 1000, "Koicho", new Battery("Samsung", 60, 200, BatteryType.LiIon), new Display(20, 60000000));

            firstGsm.CallHistory = new System.Collections.Generic.List <Calls>();
            firstGsm.AddCall(DateTime.Now, "+35987854647", 10);
            firstGsm.AddCall(DateTime.Now, "My love <3333", 32767);
            firstGsm.AddCall(DateTime.Now, "Bai Ivan", 1);
            foreach (Calls call in firstGsm.CallHistory)
            {
                Console.WriteLine(call);
            }
            Console.WriteLine("Total price:{0}", firstGsm.TotalPriceOfCalls());
            firstGsm.CallHistory = firstGsm.CallHistory.OrderBy(x => x.CallTime).ToList();
            firstGsm.DeleteCall(0);
            firstGsm.ClearCalls();
            foreach (Calls call in firstGsm.CallHistory)
            {
                Console.WriteLine(call);
            }
        }