コード例 #1
0
        public void TestInformation()
        {
            GSM[] phones = new GSM[3];
            phones[0] = new GSM("tuhla", "paragvai", "spongeBob", 1000, new Battery("lol", 1, 23141), new Display(4.5, 5));
            phones[1] = new GSM("Kroasan5000", "4i4o Mitko", "apatrahil", 600, new Battery("ROFLCOPTER", 312, 22), new Display(2, 34));
            phones[2] = new GSM("Fafla", "francuzite", "jan-mishel-jar", 3, new Battery("GTFO", 1, 1), new Display(3213, 234533));

            foreach (var item in phones)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine(GSM.iPhone4SInfo);
        }
コード例 #2
0
ファイル: GSMTest.cs プロジェクト: n-kostov/TelerikAcademy-2
        static void Main(string[] args)
        {
            //-------------------------------------------------------
            //-------Test GSM class with the unit test 07.GSMUnitTest
            //-------------------------------------------------------


            GSM[] phones = new GSM[3];
            phones[0] = new GSM("tuhla", "paragvai", "spongeBob", 1000, new Battery("lol", 1, 23141), new Display(4.5, 5));
            phones[1] = new GSM("Kroasan5000", "4i4o Mitko", "apatrahil", 600, new Battery("ROFLCOPTER", 312, 22), new Display(2, 34));
            phones[2] = new GSM("Fafla", "francuzite", "jan-mishel-jar", 3, new Battery("GTFO", 1, 1), new Display(3213, 234533));

            foreach (var item in phones)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine(GSM.iPhone4SInfo);
        }
コード例 #3
0
        static void Main()
        {
            GSM[] testArr = new GSM[3];
            GSM   nokia   = new GSM("Nokia2010", "Nokia", "Gosho", 320);
            GSM   samsung = new GSM("Galaxy S2", "Samsung", "Gabriel", 620);
            GSM   siemens = new GSM("A2", "Siemens", "Yana", 9);

            testArr[0] = nokia;
            testArr[1] = samsung;
            testArr[2] = siemens;
            for (int i = 0; i < testArr.Length; i++)
            {
                Console.WriteLine(testArr[i]);
            }
            Console.WriteLine(GSM.IPhone4S);

            Call call1 = new Call("21.02.2013", "12:30", "0888 888 888", 58);
            Call call2 = new Call("21.02.2013", "13:30", "0888 888 865", 23);
            Call call3 = new Call("21.02.2013", "12:50", "0888 888 848", 12);
            Call call4 = new Call("21.02.2013", "15:12", "0888 328 888", 135);

            nokia.AddCalls(call1);
            nokia.AddCalls(call2);
            nokia.AddCalls(call3);
            nokia.AddCalls(call4);
            for (int i = 0; i < nokia.CallHistory.Count; i++)
            {
                Console.WriteLine("Call {0}: Date:{1}, Time:{2}, Number:{3}, Duration:{4}",
                                  i + 1, nokia.CallHistory[i].Date, nokia.CallHistory[i].Time,
                                  nokia.CallHistory[i].DialedPhoneNum, nokia.CallHistory[i].CallDuration);
            }
            Console.WriteLine("Total fee is: {0}", nokia.CalculatePriceForCalls(0.37f));
            nokia.DeleteCalls(3);
            Console.WriteLine("Total fee without the fourth call is: {0}", nokia.CalculatePriceForCalls(0.37f));
            nokia.ClearCallHistory();
            Console.WriteLine("Total fee with cleared call history is: {0}", nokia.CalculatePriceForCalls(0.37f));
        }
コード例 #4
0
        static void Main()
        {
            GSM[] testArr = new GSM[3];
            GSM nokia = new GSM("Nokia2010", "Nokia", "Gosho", 320);
            GSM samsung = new GSM("Galaxy S2", "Samsung", "Gabriel", 620);
            GSM siemens = new GSM("A2", "Siemens", "Yana", 9);
            testArr[0] = nokia;
            testArr[1] = samsung;
            testArr[2] = siemens;
            for (int i = 0; i < testArr.Length; i++)
            {
                Console.WriteLine(testArr[i]);
            }
            Console.WriteLine(GSM.IPhone4S);

            Call call1 = new Call("21.02.2013", "12:30", "0888 888 888", 58);
            Call call2 = new Call("21.02.2013", "13:30", "0888 888 865", 23);
            Call call3 = new Call("21.02.2013", "12:50", "0888 888 848", 12);
            Call call4 = new Call("21.02.2013", "15:12", "0888 328 888", 135);

            nokia.AddCalls(call1);
            nokia.AddCalls(call2);
            nokia.AddCalls(call3);
            nokia.AddCalls(call4);
            for (int i = 0; i < nokia.CallHistory.Count; i++)
            {
                Console.WriteLine("Call {0}: Date:{1}, Time:{2}, Number:{3}, Duration:{4}",
                    i + 1, nokia.CallHistory[i].Date, nokia.CallHistory[i].Time,
                    nokia.CallHistory[i].DialedPhoneNum, nokia.CallHistory[i].CallDuration);
            }
            Console.WriteLine("Total fee is: {0}", nokia.CalculatePriceForCalls(0.37f));
            nokia.DeleteCalls(3);
            Console.WriteLine("Total fee without the fourth call is: {0}", nokia.CalculatePriceForCalls(0.37f));
            nokia.ClearCallHistory();
            Console.WriteLine("Total fee with cleared call history is: {0}", nokia.CalculatePriceForCalls(0.37f));
        }
コード例 #5
0
ファイル: GSMTest.cs プロジェクト: Dyno1990/TelerikAcademy-1
        static void Main(string[] args)
        {
            //-------------------------------------------------------
            //-------Test GSM class with the unit test 07.GSMUnitTest
            //-------------------------------------------------------

            GSM[] phones = new GSM[3];
            phones[0] = new GSM("tuhla", "paragvai", "spongeBob", 1000, new Battery("lol", 1, 23141), new Display(4.5, 5));
            phones[1] = new GSM("Kroasan5000", "4i4o Mitko", "apatrahil", 600, new Battery("ROFLCOPTER", 312, 22), new Display(2, 34));
            phones[2] = new GSM("Fafla", "francuzite", "jan-mishel-jar", 3, new Battery("GTFO", 1, 1), new Display(3213, 234533));

            foreach (var item in phones)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine(GSM.iPhone4SInfo);
        }