コード例 #1
0
        static void Main()
        {
            Console.WriteLine(GSM.iphone4s + "\n"); //Iphone

            //Test phone
            GSM mobile = new GSM("Galaxy-s-3-neo", "Samsung", 200, "Mitko", "HP-100", 150, 120, BatteryType.NiCd, 230, 5605);

            Console.WriteLine(mobile);

            var testGMSs = GSMTest.gsmTests;

            GSMTest.PrintTestGSM(testGMSs);

            var callHistory = CallHistoryTest.callHistory;

            GSM.DisplayCallHistory(callHistory);                   //Printing calls

            CallHistoryTest.PrintTestCallPrice(callHistory, 0.37); //Printing price

            CallHistoryTest.RemoveLongestCall(callHistory, 0.37);  //After removing longest call

            Console.WriteLine("\nClearing all call history...");
            callHistory.Clear();
            GSM.DisplayCallHistory(callHistory);
            Console.WriteLine("\nAll history cleared");
        }
コード例 #2
0
        static void Main()
        {
            //var gsmTest = new GSMTest();
            //gsmTest.DisplayInfo();

            var callHistoryTest = new CallHistoryTest();

            callHistoryTest.TestCallHistory();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            List <MobilePhone> mobilePhones = new List <MobilePhone>();

            mobilePhones.Add(new MobilePhone("1020C", "Nokia", 1299.99m, "Jhon Dow", new Battery("2307", 15, 5, BatteryType.LiIon), new Display(new DisplaySize(1980, 1024), 65000000)));
            mobilePhones.Add(new MobilePhone("Galaxy NOTE", "Samsung"));
            mobilePhones.Add(new MobilePhone("AishE", "Nokia", 299.90m, battery: new Battery()));
            mobilePhones.Add(new MobilePhone("1020C", "Nokia", 1299.99m, display: new Display(new DisplaySize(1980, 1024), 65000000)));

            foreach (var phone in mobilePhones)
            {
                Console.WriteLine(phone);
            }

            Console.WriteLine(mobilePhones[0].IPhone4SInfo);
            Console.WriteLine(mobilePhones[1].IPhone4SInfo);

            Call call = new Call(DateTime.Now, DateTime.Now.AddSeconds(177), "Pesho");

            CallHistoryTest.Test();
        }