コード例 #1
0
        static void Main()
        {
            // Static IPhone4S TEST
            Console.WriteLine(GSM.IPhone4S);

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();


            // GSM TEST
            var gsmTest = new GSMTest();

            foreach (var gsm in gsmTest.ListOFGSMs)
            {
                Console.WriteLine(gsm);
            }

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();


            // CALL History TEST
            GSMCallHistoryTest.CallHistoryTest();
        }
コード例 #2
0
ファイル: GSM.cs プロジェクト: DanteSparda/TelerikAcademy
        private static void Main()
        {
            // Inserting data:
            GSM myPhone = new GSM("Nokia", "Nokia OOD");

            myPhone.Price                  = 500;
            myPhone.Owner                  = "Ivancho";
            myPhone.battery                = new Battery(BatteryType.NiMH);
            myPhone.battery.HourIdle       = 12;
            myPhone.battery.HoursTalk      = 520;
            myPhone.display                = new Display(12);
            myPhone.display.NumberOfColors = 326;

            // Transfering data and printing
            Console.WriteLine(myPhone.PrintMobileInfo(myPhone.battery, myPhone.display));

            // Iphone4S data:
            string theIPhoneInfo = GSM.IPhone4S;

            Console.WriteLine(theIPhoneInfo);

            // and ETC
            GSM phone = new GSM("Alcatel", "Alacatelov");

            GSMTest.CreateAFewGSMs(5);

            // Adding calls
            myPhone.resentCall = new Call("0898123231");
            Console.WriteLine(myPhone.resentCall.LastNumber);
            myPhone.CallHistory.Add(myPhone.resentCall);

            // Adding a second call
            myPhone.resentCall = new Call("08788765426");

            // Adding the call to the list
            myPhone.CallHistory.Add(myPhone.resentCall);
            foreach (Call talk in myPhone.CallHistory)
            {
                Console.WriteLine(talk.LastNumber);
            }

            // From here on, the adding to the callHistory is automatic
            myPhone.AddAndRemove("add", myPhone);
            myPhone.AddAndRemove("remove", myPhone);
            double totalPrice = myPhone.TotalPriceOfCalls(myPhone);

            // Not working because I don't have thread.sleep or something to make timespan
            Console.WriteLine("Total price: {0}", totalPrice);

            // Clearing the history
            myPhone.ClearHistory();
            GSMCallHistoryTest.GSMTest();
        }
コード例 #3
0
ファイル: GSMTest.cs プロジェクト: glifada/TelerikAcademy
        public static void Test()
        {
            GSM[] phone = new GSM[]
            {
                new GSM("Samsung", "Galaxy S5"),
                new GSM("Samsung", "Galaxy S4"),
                new GSM("Samsung", "Galaxy S3"),
                new GSM("Apple", "IPhone 6S")
            };
            GSMTest test = new GSMTest(phone);

            Console.WriteLine(GSMTest.PrintInfo());
            Console.WriteLine(GSM.IPhone4S);
        }
コード例 #4
0
ファイル: GSMTest.cs プロジェクト: glifada/TelerikAcademy
        public static void Test()
        {
            GSM[] phone = new GSM[]
            {
                new GSM ("Samsung", "Galaxy S5"),
                new GSM ("Samsung", "Galaxy S4"),
                new GSM ("Samsung", "Galaxy S3"),
                new GSM ("Apple", "IPhone 6S")
            };
            GSMTest test = new GSMTest(phone);

            Console.WriteLine(GSMTest.PrintInfo());
            Console.WriteLine(GSM.IPhone4S);
        }
コード例 #5
0
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            Battery myBattery = new Battery("Bateria");
            Display myDisplay = new Display();
            GSM myGSM = new GSM("Nokia","Nokia", 100.23M, "Pesho",myBattery,myDisplay);
            string myGSMinfo = myGSM.ToString();
            Console.WriteLine(myGSMinfo);

            GSM mySecondGSM = GSM.IPhone4S;

            Console.WriteLine(mySecondGSM);

            GSMTest test = new GSMTest();
            test.Create4GSMs();

            GSMCallHistoryTest secondTest = new GSMCallHistoryTest();
            secondTest.CallHistoryTest();
        }
コード例 #6
0
 static void Main()
 {
     GSMTest.GSM_Test();
     GSMCallHistoryTest.CallHistoryTest();
 }
コード例 #7
0
 static void Main()
 {
     GSMTest.Test();
     Console.WriteLine();
     GSMCallHistoryTest.Test();
 }
コード例 #8
0
ファイル: StartUp.cs プロジェクト: molivpopov/Telerik
 public static void Main()
 {
     GSMTest.Test();
     GSMCallHistoryTest.Test();
 }