Exemplo n.º 1
0
        public static void TestCallHistory()
        {
            GSM motorola = new GSM("nexus", "Motorola", 500, "comapny phone", new Battery(BatteryType.NiCd), new Display(5, 2000));
            GSM newBrand = new GSM("SSD", "MegaHyper");

            motorola.AddCall(new Call("12/03/2015", "05:34", "0889888888", 100));
            motorola.AddCall(new Call("02.02.2012", "12:34", "0999999999", 140));
            motorola.AddCall(new Call("12.30.2012", "00:34", "0999999999", 12));
            ShowCalls(motorola.calls);
            Console.WriteLine("The Total Price is {0}", motorola.CalculateTotalPrice());
            motorola.FindAndRemoveLongestCall();
            Console.WriteLine("Longest call now removed");
            Console.WriteLine("The Total Price is {0:F2}", motorola.CalculateTotalPrice());
            motorola.ClearHistory();
            Console.WriteLine("Call history deleted");
        }