예제 #1
0
        public static void TestCallHistory()
        {
            var          gsmTester = new GSM("Galaxy", "Nokia");
            List <Calls> afewCalls = new List <Calls>();
            DateTime     now       = DateTime.Now;
            string       number    = "08888888888";
            int          duration  = 180;

            for (int i = 0; i < 10; i++)
            {
                afewCalls.Add(new Calls(now, now, number, duration));
            }

            afewCalls.Add(new Calls(now, now, number, 320));

            Console.WriteLine("Calls are from this number: " + number + " and are " + duration + " seconds long, on date " + now);

            CalculatePriceOfCalls(afewCalls, duration);
            DeleteLongestCall(afewCalls);
            CalculatePriceOfCalls(afewCalls, duration);

            foreach (var item in afewCalls)
            {
                Console.WriteLine(item);
            }
            ClearCallHistory(afewCalls);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var peshoBattery = new Battery("kirchova");
            var peshoDisplay = new Display("233x345");
            var peshoPhone   = new GSM("Galaxy", "Samsung", 23.34, "Pesho", peshoBattery, peshoDisplay);

            //PrintAllProperties(peshoPhone);

            //System.Console.WriteLine(peshoPhone);

            //string a = GSM.IPhone4S;
            //System.Console.WriteLine(a);

            //var gsmTest = new GSMTest();
            //gsmTest.Add(peshoPhone);
            //gsmTest.PrintAllInstances(gsmTest.GSMInstances);

            GSMCallHistoryTest.TestCallHistory();
        }
예제 #3
0
 public void Add(GSM item)
 {
     gsmInstances.Add(item);
 }